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
52
7
137
20.9K
Sergei Kotov
Sergei Kotov@kotov_dev·
@PythonPr Answer: C) No Step by step: › m = 'N' (string) › n = 'o' (string) › p = 5 (not used!) › m + n = 'N' + 'o' = 'No' For beginners: String concatenation with +! Notice p is defined but never used -- it's there to distract you.
English
1
0
9
814
ANKIT 𓃱
ANKIT 𓃱@A9kitSingh·
@PythonPr Answer: C) No m and n are strings, so + concatenates them. 'N' + 'o' : No. p = 5 is unused.
English
0
0
6
1.3K
Kamal Gurjar
Kamal Gurjar@KamalGurjar8·
@PythonPr Answer: C) No Because both m and n are strings. m + n performs string concatenation, not arithmetic. So 'N' + 'o' → "No".
English
0
0
4
1.2K
Jenny
Jenny@JennyTheDev·
@PythonPr C) No m + n = 'N' + 'o' = 'No' p = 5 is just a distraction - never used
English
0
0
3
677
Python Tech
Python Tech@PythonTech43716·
@PythonPr No is the right answer. Simple use the concept of string concatenation.
English
0
0
0
5
Paylaş