I'm trying to run a for
loop inside of a while
loop, but for some reason it's not being run at all.
Here's the code:
with open("Nominees_18.csv") as nominees:
reader = csv.reader(nominees)
next(reader)
for c, row in enumerate(reader):
print(row[0], row[1], c)
while True:
name = input("chose a number")
print(4)
for c, row in enumerate(reader):
print(4)
if str(c) in name:
print(len([i for i in row if row[i] == "y"]))
if input("chose another?") == ("no" or "No"):
break
The script asks you for a number, then asks if you want to choose another number. I put print(4)
to test the for loop and it doesn't come up.
There's further code above this but I haven't included it as I don't think it's relevant, but if you want it, then let me know.
I have no idea why this could be happening.
Thanks.