Ask your own question, for FREE!
Computer Science 17 Online
OpenStudy (anonymous):

Write a Python program where the user can enter a list of strings followed by the sentinel "DONE" and the list of strings is then printed out right-aligned with the longest string. This is what I have but it doesn't work, please can someone assist: def Right_Align(names): longest=max(names,key=len) newlist="{0:>longest}".format(names) def main(): names= [] while not names=='DONE': names=input('Enter strings (end with DONE):\n').split('\n') print("Right-aligned list:\n",Right_Align(nameslist)) main()

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!