C-16-Q038mediumsingle_mcq
Given the following code, what will be printed in order?
value_now = 1
print(value_now)
value_now = 2
print(value_now)
value_now = 3
print(value_now)
Given the following code, what will be printed in order?
value_now = 1
print(value_now)
value_now = 2
print(value_now)
value_now = 3
print(value_now)
- a
1 1 1 - b
3 3 3 - c
1 2 3 - d
3 2 1
ব্যাখ্যা
Each print runs immediately after the variable is updated, so it shows the current value at that moment: first 1, then 2, then 3. The reassignments happen in sequence, producing the order 1 2 3.