What would be the output of the following code snippets? print 4+9 print “4 +9”

 

Answer:

Code 3 - Teachoo.jpg

Output:

13

4 +9

Explanation:

  • In the first print statement, 4 and 9 are considered as integers and ‘+’ is an operator that adds 4 and 9 and then prints the output 13.
  • In the second print statement “4+9” is considered a string since they are enclosed in quotes.
Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo