Computer Science
Predict the output:
a, b = 12, 13
print (print(a + b))
Python
Python Funda
37 Likes
Answer
Output
25
None
Explanation
a, b = 12, 13
⇒ assigns an initial value of 12 to a and 13 to b.print (print(a + b))
⇒ First print(a + b) function is called which prints 25. After that, the outer print statement prints the value returned by print(a + b) function call. As print function does not return any value so outer print function prints None.
Answered By
16 Likes
Related Questions
Predict the output:
x, y = 20, 60 y, x, y = x, y - 10, x + 10 print (x, y)
Predict the output:
a, b = 12, 13 c, b = a*2, a/2 print (a, b, c)
Predict the output
a, b, c = 10, 20, 30 p, q, r = c - 5, a + 3, b - 4 print ('a, b, c :', a, b, c, end = '') print ('p, q, r :', p, q, r)
Find the errors in following code fragment:
y = x + 5 print (x, Y)