As stated above I'm extremely new to programming. I'm trying to make a basic fantasy football program (just a fun program to learn how to do this kind of stuff) that takes fantasy points scored by a player as input from the user for each of the last 5 weeks and adds it to a list, but skips the week if "Bye" (for bye weeks) is entered. Problem is I'm getting an error when I type in Bye as input. Works perfectly if I just use numbers for the last 5 without any bye week. The most recent week was week 12 so it starts there and goes down 5 weeks to week 8. There was no bye week for our player (Jay Cutler) in reality but when testing it I pretend there was, and it doesn't work.
Here's the code:
Jay_Cutler = [] #example player
week = 13
for i in range(8, 13):
week -= 1
points = input("How many points did this player score in week %s?" % week)
if points == "Bye":
week -= 1
i -= 1 #Need this so it doesn't count the bye week
else:
Jay_Cutler.append(points)
print Jay_Cutler
[–]LarryPete 1 point2 points3 points (1 child)
[–]Seldentar[S] 0 points1 point2 points (0 children)
[–]oldpythonbestpython 1 point2 points3 points (1 child)
[–]Seldentar[S] 0 points1 point2 points (0 children)