Question: 1 . 1 2 ) Concerning the following program def square ( n ) : Slist 1 = [ ] Slist 2 = [ ]

1.12) Concerning the following program
def square (n) :
Slist 1=[]
Slist2=[]
i=0
for j in range (1,n) :
Slist1. append (j****2
while (True) :
if Sl ist 1[i]i+=1Sn1[i] :
Slist2. append (Slist1[i])
i+=1
cont inue
else:
break
return S list2
print (Slist2)
square (100)
Which of the following statementsisare correct?
A. Function square() has only one return value.
B. Function square() uses a definite loop to return a list of numbers that are square with total list length that less or equal to the input parameter n.
. The length of the list Slist2 has not been set beforehand.
D. The result of the program is shown as following:
 1.12) Concerning the following program def square (n) : Slist 1=[]

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!