Running this code where I am asking the user if they want the code in reverse order.
Everything runs smoothly, however when the program runs the section Do you want reverse order (y/n)
, it prints None
on the next line for some reason?
Can anybody explain why/how I get this to stop?
def farmList():
print("Please enter six farming animals: ")
terms = []
for counter in range(6):
term = input("Please enter a farm animal")
terms.append(term)
reverseOrder = input("Do you want reverse order (y/n)")
if reverseOrder == "y":
print(terms[::-1])
else:
print(terms)
whichTerm = int(input("Choose a number between 1-6, and the program will print that animal: "))
print(terms[whichTerm-1])