thecaptainjera
thecaptainjera

Reputation: 3

Python in Sublime Text 3 won't respond on simple operations

My editor Sublime Text 3 don't respond on code like: 2+2

Here is the case enter image description here

Every other code like: print("Hello World") , works perfectly. Is there any solution or I need to change editor?

Upvotes: 0

Views: 165

Answers (3)

cs95
cs95

Reputation: 402263

my editor Sublime Text 3 don't respond on code like: 2+2

If you want this behaviour you need to fire up a python interpreter. Sublime Text 3 does not interpret your code. It just executes your scripts.

If you want to display output, you'll need to print it.

Upvotes: 1

Haifeng Zhang
Haifeng Zhang

Reputation: 31885

I just didn't display on console. You can use print(2+2) to print out the result

Upvotes: 2

Xukrao
Xukrao

Reputation: 8633

This is normal behaviour. When running a script file, you have to use print to display any outputs. For example:

x = 2 + 2
print(x)

Upvotes: 1

Related Questions