Python Programming - Data Types - Discussion

Discussion Forum : Data Types - General Questions (Q.No. 36)
36.
What will be the output of the following code snippet?
x = 10
y = "5"
result = x + int(y)
print(result)
15
105
"10" + "5"
Error
Answer: Option
Explanation:
The int(y) converts the string '5' to an integer, and then the addition results in 10 + 5 = 15.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.