This is part of a bigger problem, but I’m having some problems with this if/elif function.
def fish():
import random
score = 0
i = random.randint(0,39)
if i == [0,19]:
print("You caught nothing!")
elif i == [20,39]:
print("You caught a Minnow! +10 points.")
score += 10
print(i)
print(score)
fish()
When I run this, all I get is the randint number, and 0 for the score. I’m not exactly sure what I’m doing wrong here.
You’re comparing an integer to a list.
To do what you’re trying to do, here’s one way: