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
33
11
83
11.7K
Jenny
Jenny@JennyTheDev·
@PythonPr B) 5 y copies the value of x, not a reference. When x changes, y stays the same. Basic but tricky for beginners!
English
0
0
5
627
Kamal Gurjar
Kamal Gurjar@KamalGurjar8·
@PythonPr Output: B) 5 y is assigned the value of x at that moment (x = 5). Reassigning x to 10 later doesn’t affect y. Python assigns values, not references, for immutable types like integers.
English
0
0
3
907
Jay
Jay@learnaiwthme·
@PythonPr B) 5. y gets the value of x at assignment time. Reassigning x later doesn’t change y.
English
0
0
2
652
pooja_jha
pooja_jha@poojajha29·
@PythonPr Output: B x = 5 & y = x x= 10 //after assigned value So print(y) = 5
English
0
0
1
464
Vinh Quang
Vinh Quang@QinZinnn·
@PythonPr Output: B the "x" in y = x is the x=5, not the x=10
English
0
0
0
8
Newton Achonduh
Newton Achonduh@unphishabl21697·
@PythonPr HTTPS doesn’t mean safe. Unphishable v1.0 is live — detecting phishing by correlating SSL issuer type, redirects, and WHOIS opacity. 🔍
Newton Achonduh tweet media
English
0
0
0
0
Ibukun Omolayo
Ibukun Omolayo@IbukunOmolayo·
@PythonPr Okay looking at the code X as been assigned a new variable which is y It clear shows it isn’t a string cause if it is, it will be added under “_” So the answer is 5
English
0
0
0
21
Ehshanulla
Ehshanulla@Ehshanulla·
@PythonPr i) X assign the value 5 ii) Y gets the value of X 5 iii) X reassigned the value 10 iv) print(y) gets the output of Y =5
English
0
0
0
173
JA ŘÕ
JA ŘÕ@JaroMohamed·
@PythonPr A) 10 final values of x is 10 then y = x
English
0
0
0
40
Paylaş