Okay so I'm trying to do two things let me post my code real quick:
def main():
animals = ["Monkey", "Parrot", "Dog", "Koala", "Giraffe"]
favAnimal = input("What is your favorite animal?")
print("What is your favorite animal?")
if(favAnimal == animals):
print("The " + favAnimal + " is both of our favorite's!")
else:
print("We don't like any of the same animals. D;")
number= 1
for n in range(0, 5):
print(number + "." + animals[n])
number=number+1
main()
So in the if statement I'm trying to figure out how to check if the users input is the same as any of the items in the animals list and if it is print that statement.
The other thing I'm trying to do is in the for loop I'm printing out the animals list with ascending numbers as such:
- Monkey
- Parrot 3... etc
I've tried different things but nothing has worked for the for loop it keeps saying I need to add int or float to line 18 (the print number line) but when I do it doesn't seem to work.
Can anyone help me out with this?