-1
modo = int(input("Selecionar modo de jogo: "))
if modo == 1
print("deu 1")
if modo == 2
print("deu 2")
I just wanted to test if the user, when typing 2 the program prints 2 and the same pro 1, but ta giving syntax error, algm ajuda me
-1
modo = int(input("Selecionar modo de jogo: "))
if modo == 1
print("deu 1")
if modo == 2
print("deu 2")
I just wanted to test if the user, when typing 2 the program prints 2 and the same pro 1, but ta giving syntax error, algm ajuda me
2
From what I’m seeing your code has a number of errors:
if
, the next line must contain 4 spaces in relation to the top line. if
and its conditions, there must be the two-point sign (:) then for python to be able to assimilate that it is a block of code.Regarding your problem, this is the code you are looking for:
modo = int(input("Selecionar modo de jogo: "))
if modo == 1:
print("deu 1")
if modo == 2:
print("deu 2")
I didn’t read it, I did it kind of rushing because I would need it for tomorrow, but I’m going to take a look at some classes, thank you.
@Kah, if the answer was satisfactory to your problem, please mark it as accepted,! :)
Browser other questions tagged python syntax basic
You are not signed in. Login or sign up in order to post.
if
must be indented relative to it; 2) Missing two dots,:
, at the end of allif
;– Woss