116k views
0 votes
What does this function do?

def guess_function(guess_List):
if len(guess_List) == 1:
return guess_List[0]
else:
return guess_List [0] + guess_function(guess_List[1:])

1 Answer

6 votes

Answer:

below

Step-by-step explanation:

It checks guess_List and if it only has 1 item, returns the first item as the function. Otherwise, it returns the first item added to the items from the second item onwards in guess_List.

User Suganthan Raj
by
3.9k points