Question: PROBLEM ONE: For the following question, all answers should be based on the the list s provided: s = [1,2,3,4,5,6,7,8,9,10] Cases: a. for i in

PROBLEM ONE:

For the following question, all answers should be based on the the list s provided:

s = [1,2,3,4,5,6,7,8,9,10]

Cases:

a. for i in range(s):

print(i)

b. for i in s:

print(i)

c. for i in s:

print(s[i])

d. for i in s:

print(s(i))

e. for i in range(len(s)):

print(i)

f. for i in range(len(s)):

print(s[i])

g. for i in range(11):

print(i)

h. for i in range(len(10)):

print(i)

Questions:

a. For each of the cases a-h, identify which of the cases prints out each VALUE of the list s.

b. For each of the cases a-h, identify which of the cases prints out each INDEX of the list s.

c. For each of the cases a-h, identify which cases 1) results in an error and 2) what is the cause of the error.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!