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
9
6
36
7.6K
Himanshu Kumar
Himanshu Kumar@codewithimanshu·
@PythonPr Right, that's a good one, Python! The output depends on how you've set up the code, but the logic is key, you see.
English
0
0
0
122
Earnest Codes
Earnest Codes@Earnesto037·
@PythonPr This would result in an Error due to two main reasons: using an undefined variable and using an invalid unary operator. To make the code functional and achieve a logical result (assuming the intent was to perform an increment operation, which is
English
0
0
0
226
Oladotun Johnson | Fuelet | $RVV
@PythonPr D). None of these. Python does not support ++=. It's a wrong syntax. More so, no variable x is defined. So, this is a very wrong expression.
English
0
0
0
181
propeace
propeace@propeace001·
@PythonPr I want to start a Python Quiz with my Undergrad Students. Any suggestions?
English
0
0
0
94
hop07
hop07@hop07·
@PythonPr File "/home/hop/wk/python/scratch/smpl.py", line 1 a=10 | b=20 | b=++x | print(b) ^^^^^^ SyntaxError: cannot assign to expression
English
0
0
0
33
Paylaş