[Python] How to run code in VSCode using the terminal?

Discussão em 'Python' iniciado por Stack, Julho 21, 2025.

  1. Stack

    Stack Membro Participativo

    I'm really confused on why this isn't working. I assign the value 5 to the variables num_one and then assign the value 10 to num_two. Then I add them together and print that but it outputs 9 to the terminal.

    The name of the file is variables.py and when I try to run it VSCode using "py variables.py", "python variables.py", or "python3 variables.py" it outputs 9 to the terminal. Obviously, I'm expecting the answer to be 15 but for some reason it's not updating.

    num_one = 5
    num_two = 10
    print(num_one + num_two)

    Continue reading...

Compartilhe esta Página