Post

Python Programming
Python Programming@PythonPr·
Python Question / Quiz; What is the output of the following Python code, and why? Comment your answers below!
Python Programming tweet media
English
40
12
139
16.5K
Kamal Gurjar
Kamal Gurjar@KamalGurjar8·
@PythonPr Answer: B) 10 Tweet-ready 👇 y is a string, but int(y) converts "5" → 5. So x + int(y) = 5 + 5 = 10 ✅ Python adds numbers, not strings—type conversion matters.
English
0
0
14
1.5K
ANKIT 𓃱
ANKIT 𓃱@A9kitSingh·
@PythonPr Answer is B) 10 y is converted to an integer, so 5 + 5 = 10.
English
0
0
4
482
Jenny
Jenny@JennyTheDev·
@PythonPr B) 10 int(y) converts the string to integer first, then addition happens. No concatenation here
English
0
0
2
1.2K
anjitweet 🍃
anjitweet 🍃@ABodigam56131·
@PythonPr Answer is 10 Actually, y is a string because it is in double quotes but, int (y) converts string to integer so, print (x+int(y)) Is 5+5=10
English
0
0
2
423
Nazish Alam
Nazish Alam@NazishA28345005·
@PythonPr 10 string change into int type then addition take pla ce...
English
0
0
1
70
Rohith
Rohith@Rohith_264·
@PythonPr X=5 Y="5" after type conversion Y=5 5+5=10💯
English
0
0
1
113
Nath Lugo
Nath Lugo@BursatilGirl·
@PythonPr B) 10 "int" tells Python to convert "5" to an integer
English
0
0
1
323
Siddartha DevOps
Siddartha DevOps@SiddarthaDevops·
@PythonPr Ans) 10 x is an integer and y is string. python can't convert strings automatically, we have to do explicitly. we convert string into integer, so now python does normal arithmetic.
English
0
0
0
5
V CHANDRASEKAR
V CHANDRASEKAR@VCHANDR38545860·
@PythonPr C Type error One 1st Son V.CHANDRASEKAR BCA MCA.,1st Sex All girls each one one girl come.
English
0
0
0
7
Paylaş