Consider the following code fragment. 1 x = 10 y = 2 2 3 4 while x >= 0: X = x 1 У — у* 2 if x == 7 5 and (y % 5) != 0: 8 break 9 10 print(x) 11 print(y) Trace the code and for each iteration of the...



  1. Consider the following code fragment.
    Trace the code and for each iteration of the while loop write the updated values of x and y. What does this code finally print out on lines 10 and 11?


Consider the following code fragment.<br>1 x = 10<br>y = 2<br>2<br>3<br>4<br>while x >= 0:<br>X = x<br>1<br>У — у* 2<br>if x ==<br>7<br>5 and (y % 5) != 0:<br>8<br>break<br>9<br>10<br>print(x)<br>11<br>print(y)<br>Trace the code and for each iteration of the while loop write the updated values of x and<br>y. What does this code finally print out on lines 10 and 11?<br>LO<br>

Extracted text: Consider the following code fragment. 1 x = 10 y = 2 2 3 4 while x >= 0: X = x 1 У — у* 2 if x == 7 5 and (y % 5) != 0: 8 break 9 10 print(x) 11 print(y) Trace the code and for each iteration of the while loop write the updated values of x and y. What does this code finally print out on lines 10 and 11? LO

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here