Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
if tries %6 == 0:
        print("did you chose a word ?")
        input()
        lost = list
print("oops I will try again")
list .append(guess)
lost .remove(guess)


What I have tried:

i tried to use pass and continue
Posted
Updated 10-Sep-21 9:06am

1 solution

Python indentation is significant: it handles flow control by "grouping" lines of code together into "blocks" according to the same level of indentation. Stupid, I know - but I didn't design the thing.

So if you want the line only printed when tries % 6 == 0 then indent it to teh same level as the rest of the block:
        print("did you chose a word ?")
        input()
        lost = list
        print("oops I will try again")
If you want to only do it when the condition fails, then you need to add an else statement: Python Conditions[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900