I was just playing with Python, but when I tried to branch y/n using the if statement, I got an invite syntax.
When I looked up the error online, it said that I forgot to attach a full-width space or colon, but I didn't feel like I saw such a grammatical error.
What should I do?
code:
check=input("y/n");
if check == "y";
print(num+nnuumm)
else;
I don't know how to display the code in the stackoverflow for the first time, but please forgive me.
The error line is
if check=="y";
That's it.
python
The if
statement ends with :
instead of ;
(semi-colon).( else
as well)
example description:
if conditional expression:
© 2025 OneMinuteCode. All rights reserved.