This seems like a bug, if it is what do I do?

This keeps my code from running, so what should I do?
I could be wrong, but I believe this is a bug. It tells me a colon is expected, but there’s already one there. If you add another or if you remove it altogether it says the same thing.
Here’s a screenshot of the code in question:

1 Like

Here’s a screenshot that includes the error.

1 Like

In your code, instead of option _4, you should use option_4, or option_1 instead of option _1. You put extra spaces in the variable names.


A small tip in programming is that most error messages are useful, but sometimes they can basically be complete nonsense.
Here, python says there should be a colon when the real problem is that there is a space in your variable name.


So weird. I’d at least expect ‘Expected “)”’


Maybe option: 4 would be valid syntax.

In this case, no.
But a few changes and it would be “valid”, remove the parentheses and the loop body:

while ('a' == 'b') or ('b' == 'c') or ('c' ==
'c') or option_3 == option:4

I don’t know much about languages and syntax, but any language may have a hard time giving you the actual solution when, from the language’s perspective, all of the code is messed up, from a single typo.

1 Like

I put another person’s response as the solution, but you said the same thing. I appreciate it!

This worked, thank you!

Shoutout to Pyright for keeping me from seeing the typo.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.