1. Assume the program below starts with initial values of list1 =[7, 1, -1, 2], w = -2, x = 2, y = 12, z = -5. Indicate
Posted: Tue Jul 12, 2022 8:11 am
1.
Assume the program below starts with initial values of list1=[7, 1, -1, 2], w = -2, x = 2, y = 12, z = -5. Indicate the valuethat will be displayed after running the followingprogram:
while y > z:
z = z + x
y -=1
x += 1
print(x,y,z)
2.
Assume the program below starts with initial values of list1=[7, 1, -1, 2], w = -2, x = 2, y = 12, z = -5. Indicate the valuethat will be displayed after running the followingprogram:
while y > list1[2]:
y -=2
w = w+1
print(w,y,z)
3.
Assume the program below starts with initial values of list1=[7, 1, -1, 2], w = -2, x = 2, y = 12, z = -5. Indicate the valuethat will be displayed after running the followingprogram:
while True:
if w >= len(list1):
break
if list1[w] < 0:
w += 1
continue
else:
z = z + list1[w]
y += 1
w += 2
print(w,x,y,z)
Assume the program below starts with initial values of list1=[7, 1, -1, 2], w = -2, x = 2, y = 12, z = -5. Indicate the valuethat will be displayed after running the followingprogram:
while y > z:
z = z + x
y -=1
x += 1
print(x,y,z)
2.
Assume the program below starts with initial values of list1=[7, 1, -1, 2], w = -2, x = 2, y = 12, z = -5. Indicate the valuethat will be displayed after running the followingprogram:
while y > list1[2]:
y -=2
w = w+1
print(w,y,z)
3.
Assume the program below starts with initial values of list1=[7, 1, -1, 2], w = -2, x = 2, y = 12, z = -5. Indicate the valuethat will be displayed after running the followingprogram:
while True:
if w >= len(list1):
break
if list1[w] < 0:
w += 1
continue
else:
z = z + list1[w]
y += 1
w += 2
print(w,x,y,z)