0

Print("2"+"2") is 2+2. But where to use these type syntax in python

22nd Jul 2019, 12:57 PM
Akhil Sharma
Akhil Sharma - avatar
4 Answers
+ 3
The output of Print("2"+"2") is 22. you can use this when you need to type the input from user as numbers and to print the eqution like : Print("2"+"2"+"="+str(2+2)) #the out put will be 2 + 2 = 4 try the following code: x = eval(input(Enter 1st number)) y = eval(input(Enter 2nd number)) print (str(x) + " + " + str(y) + " = " + str(x+y))
22nd Jul 2019, 2:06 PM
Shehab Magdy
Shehab Magdy - avatar
+ 2
Assume your input for x = 2 and for y = 3 the output will be.. 2 + 3 = 5
22nd Jul 2019, 4:07 PM
Shehab Magdy
Shehab Magdy - avatar
0
Output of this is
22nd Jul 2019, 2:13 PM
Akhil Sharma
Akhil Sharma - avatar
0
4
16th Mar 2024, 1:09 AM
Grant Abston
Grant Abston - avatar