Post

@PythonPr Answer: a) 3|2|1|0|
› while(j) means "while j is truthy"
› 0 is falsy, all other numbers truthy
› j=4: subtract, print 3|
› j=3: subtract, print 2|
› j=2: subtract, print 1|
› j=1: subtract, print 0|
› j=0: falsy, loop ends
For beginners: while (j) = while j != 0
English

@PythonPr Answer: (a) 3|2|1|0|
The code starts with the variable j initialized to 4. The while loop continues as long as the condition while(j) is true. In Python, any non-zero number is considered True. First iteration: j is 4. The condition while(4) is true. j
English

@PythonPr a. j is decremented by 1 before print statement and loop doesn't execute for j=0.
English

@PythonPr a
• j is decremented to 3 before the print operation.
• The while loop executes until the valuecl of j is >=0, resulting in a string ending in 0|
English




















