0
Why do I need to give print command for mathematical operations?
In Simple operation chapter, it is said that python can calculate directly. "Python has the capability of carrying out calculations. Enter a calculation directly into the Python console, and it will output the answer." There was no result when I entered 2+2 in the code playground. However print(2+2) gives output 4. But print("2+2") gives 2+2.
2 ответов
0
in a proper IDE (not the solo playground) entering 2+2 does result in 4
"2+2" is a string, so it will always be printed as 2+2 onto the screen. it isn't 2 numbers with an operator in the middle, it is basically words that look like 2+2
0
Thanks Justin