Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
347 views
in Technique[技术] by (71.8m points)

counter - expected indent block in idle python

I have been coding a game where I have to generate two numbers and then make a counter for every wrong guess but I attempted to get the counter set up and it isn't working it is saying indent block expected I have no idea where this comes from or if my code will work correctly and I was wondering if I could get some help because the counter isnt working and is making some error messages and doesn't go above one https://i.stack.imgur.com/AjMav.png

question from:https://stackoverflow.com/questions/65941355/expected-indent-block-in-idle-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Consider

>>> if True:
a=3
SyntaxError: expected an indented block

The line after the if header must be indented. In IDLE, the first character in the non-indented line should be highlighted in the error color (red).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...