I just didn't display on console. You can use print(2+2)
to print out the result
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)
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.