What to when you actually want to print 2+2 and not the answer of 2+2 in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What to when you actually want to print 2+2 and not the answer of 2+2 in python

18th Nov 2020, 9:25 AM
Vishwa Panchal
Vishwa Panchal - avatar
2 Answers
+ 5
Write it as a string: "2+2"
18th Nov 2020, 9:26 AM
Olivia
Olivia - avatar
+ 1
You will get same result as you put in the string such as print("2+2") Output 2+2
1st Dec 2020, 4:01 PM
Hamza Khan
Hamza Khan - avatar