What will be the output of the following code?
x = True A
y = 100
while x:
print (y)
y = y–10
If y < 50:
x = false
Show with the help of a dry run table
Answer:
Output with dry run table:
x |
y |
output |
True |
100 |
100 |
|
90 |
90 |
|
80 |
80 |
|
70 |
70 |
|
60 |
60 |
|
50 |
50 |
False |
40 |
|