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
7
18
145
11K
Sergei Kotov
Sergei Kotov@kotov_dev·
@PythonPr Answer: C) 10 Step by step: x > y = False, x and y = 10 (truthy value), so False or 10 = 10. The trick: Python's 'or' returns the first truthy value, not just True/False! This catches many beginners off-guard.
English
0
1
22
560
Paylaş