I'm new to python and can't figure out why my code is throwing out this error. I'm trying to use c to compare the two lists.
def playPowerball():
powerball = []
choices = []
c = []
while len(powerball) < 6:
number = random.randint(1,64)
if number not in powerball:
powerball.append(number)
while len(choices) < 6:
pick = int(raw_input('Pick a number between 1 and 64: '))
if pick not in choices:
choices.append(pick)
for i in powerball:
for i in choices:
c += 1
print ('You have',c,'correct',powerball,choices)
Error:
U:\Python\Lottery Ticket.py in playPowerball()
15 choices.append(pick)
16 for i in powerball:
---> 17 if i in choices:
18 c += 1
19 print ('You have',c,'correct',powerball,choices)
TypeError: argument of type 'int' is not iterable
Edit: I did mean choices instead of pick, yet the code still doesn't work.
Edit 2: Thank you, sKwa, that solved my issue!