Question: Match the following lines of code with their corresponding method of creating a loop or recursion. - def count ( x = 0 , limit

Match the following lines of code with their corresponding method of creating a loop or recursion.
-
def count (x =0, limit =10):
while x < limit:
prinit (x)
x = x+1
else:
return (limit)
print(count())
-
def count (x, limit =10):
return ([i for i in range (x, limit)])
print (count(0))
-
def count (x =0, limit =10):
if x < limit:
prinit (x)
return count(x +1)
else:
return (limit)
print(count())
-
def count (x=0, limit=10):
loop until x = limit:
print (x)
x = x+1
print(count())
A.
While Loop
B.
Not a valid method of creating a loop or recurrsion
C.
For Loop
D.
recurrsion

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 Programming Questions!