How would a hand trace table look for this code? INPUT: lime, raspberry, apple, raspberry, DISCONTINUE
def cal(item):
mylist = []
while True:
newone = input("Please enter " + item + "\"DISCONTINUE\" to stop entering: ")
print(newone)
if newone == "DISCONTINUE":
break
if newone not in mylist:
mylist.append(newone)
else:
print("That already exists in a list!")
mylist.sort()
return mylist
uniquelist = cal("a fruit")
print("Here's the sorted list: ")
print(uniquelist)
Are there any questions left?
New questions in the section Python