I'm trying to increment a for loop within itself if a certain condition is met, as shown in the code below
for i in range(0,5):
if condition == True:
i+=1
print(i)
If it runs as I want it to, the output should be: "1 3 5". Instead, the output is "0 1 2 3 4". Can anyone help me with this?