开发者

How to run code in VSCode using the terminal?

开发者 https://www.devze.com 2022-12-07 21:34 出处:网络
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 te

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 termina开发者_如何学Gol. 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)


That code produces the expected 15.

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

You didn't supply any config or debug details that would help us understand how your IDE interpreter differs from the cPython 3.10.8 which produced the above results.

0

精彩评论

暂无评论...
验证码 换一张
取 消