1.
Assume the program below starts with initial values of list1=[3, -2, 5, 7], w = 1, x = 2, y = 3, z = 4. Indicate the value thatwill be displayed after running the following program:
for item in list1:
w = w + 2*item
if w > 10:
break
print(w)
2.
Assume the program below starts with initial values of list1=[3, -2, 5, 7], w = 1, x = 2, y = 3, z = 4. Indicate the value thatwill be displayed after running the following program:
val = 0
for num in list1:
if num > 5:
continue
else:
val += num
print(val)
3.
Assume the program below starts with initial values of list1=[3, -2, 5, 7], w = 1, x = 2, y = 3, z = 4. Indicate the value thatwill be displayed after running the following program:
for i in range(3, 30, 2):
z = z + i
x = x + 1
y = x + z
print(x,y,z)
1. Assume the program below starts with initial values of list1 =[3, -2, 5, 7], w = 1, x = 2, y = 3, z = 4. Indicate the
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am