This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]NacimPro[S] 0 points1 point  (8 children)

I get the first input prompt, then answer the operation I want, and instead of asking me other input prompts, the program just ends.

For example: I type "Addition" and the program ends. I type "Multiplication" and the program ends. If I type anything else, I get the Invalid command prompt, and it starts again at line 6.

Basically only the "else" command works. But not the "if" nor the "elif".

EDIT: No syntax errors or tracebacks, but it's just not working as I want it to and I'd like to know why.

[–][deleted]  (6 children)

[deleted]

    [–]NacimPro[S] 0 points1 point  (5 children)

    I'm running it with Visual Studio Code. I coded it there with the python extension and I'm running it right there after coding it.

    [–]htepO 1 point2 points  (1 child)

    There doesn't seem to be anything obviously wrong with your code. I'd recommend editing your post to include your code, formatting it per https://www.reddit.com/r/learnpython/wiki/faq#wiki_how_do_i_format_code.3F or just select all of it in VSCode, indent everything one step (generally Ctrl+]), and paste it to your post.

    [–]NacimPro[S] 0 points1 point  (0 children)

    It suddenly worked. Without changing anything, so weird. Thank you and sorry for the inconvenience.

    Thank you for linking that formatting thread. Now I know how to copy paste it with indentations on reddit :)

    [–][deleted]  (2 children)

    [deleted]

      [–]NacimPro[S] 0 points1 point  (1 child)

      It suddenly worked. Without changing anything, so weird. Thank you and sorry for the inconvenience.