# Tuple exercise
# Populate a list from the command line then create a tuple
# from the sorted list

# Initialise the list to be empty
list1 = []

# Loop around asking for new items from the user
cont="yes"
while cont == "yes":
    print
    value = raw_input("Enter a string to add to a list: ")
    # Add to the list
    list1.append(value)
    print "The list is now: ",list1
    # Add another?
    print
    cont = raw_input("Enter another string? (yes/no) ")

# End of input
print
print "The final list is: ",list1

# Sort the list
list1.sort()
print
print "The sorted list is: ",list1

# Make a tuple
tuple1 = tuple(list1)
print
print "The resulting tuple is: ",tuple1
    
    
