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:

Long Question 3 - Teachoo.jpg

Output with dry run table:

x

y

output

True

100

100

 

90

90

 

80

80

 

70

70

 

60

60

 

50

50

False

40

 

 

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo