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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post by answerhappygod »

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)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply