#question1
#Tendani Netshitenzhe
#25 April 2014

#Create an empty list
mylist = []

#Get list of strings
names = input("Enter strings (end with DONE):\n")
while names != "DONE":
    mylist.append(names)
    names = input("")

#Get the length of the list    
length = len(mylist)

print("\nRight-aligned list:")

width = 0
for i in range(length):
    if len(mylist[i]) > width: #Get length of the string with the max length
            width = len(mylist[i]) #Assign it to width
            
for i in range(length):
    name = mylist[i]
    print(name.rjust(width)) #printing aligned list
    


22b52810a2d1e9679f229c8a7fd47cc1fbe2de0a
<mask token>

<mask token>
while names != 'DONE':
    mylist.append(names)
    names = input('')
<mask token>
print("""
Right-aligned list:""")
<mask token>
for i in range(length):
    if len(mylist[i]) > width:
        width = len(mylist[i])
for i in range(length):
    name = mylist[i]
    print(name.rjust(width))

mylist = []
names = input('Enter strings (end with DONE):\n')
while names != 'DONE':
    mylist.append(names)
    names = input('')
length = len(mylist)
print("""
Right-aligned list:""")
width = 0
for i in range(length):
    if len(mylist[i]) > width:
        width = len(mylist[i])
for i in range(length):
    name = mylist[i]
    print(name.rjust(width))

#question1
#Tendani Netshitenzhe
#25 April 2014

#Create an empty list
mylist = []

#Get list of strings
names = input("Enter strings (end with DONE):\n")
while names != "DONE":
    mylist.append(names)
    names = input("")

#Get the length of the list    
length = len(mylist)

print("\nRight-aligned list:")

width = 0
for i in range(length):
    if len(mylist[i]) > width: #Get length of the string with the max length
            width = len(mylist[i]) #Assign it to width
            
for i in range(length):
    name = mylist[i]
    print(name.rjust(width)) #printing aligned list
    

