Aug-24-2020, 01:27 PM
(This post was last modified: Aug-24-2020, 01:27 PM by deanhystad.)
Just wondering, are there expected syntax errors?
Your indentation is all over the place. Fix that.
This is where I get a syntax error:
https://docs.python.org/3/reference/comp...-statement
I also think it is a good idea to read the documentation in its entirety. Devote some of your "Python time" to reading a section from the language reference or reading about one of the standard libraries.
Your indentation is all over the place. Fix that.
This is where I get a syntax error:
else retry == "n": # if no the loop is closedThe reason is else can only be followed by :, not another condition. If you want another condition use elif as you did here:
elif score == 3 or score == 4:From the Python documentation:
https://docs.python.org/3/reference/comp...-statement
8.1. The if statement The if statement is used for conditional execution: if_stmt ::= "if" assignment_expression ":" suite ("elif" assignment_expression ":" suite)* ["else" ":" suite]I hate to be a RTFM guy, but when you are learning a programming language it is a really good idea to read the manual. You don't have to read everything at once, but at least read it piecemeal. If you are having a problem at an "if ... else" go look at the documentation for if/else.
I also think it is a good idea to read the documentation in its entirety. Devote some of your "Python time" to reading a section from the language reference or reading about one of the standard libraries.