Three small functions are defined. Two of them call themselves, and one uses a loop.
def a(n):
if n == 0:
return 0
return n + a(n - 1)
def b(n):
total = 0
for k in range(n):
total += k
return total
def d(n):
if n <= 1:
return n
return n * d(n - 1)
Which of these expressions are True? Choose every correct option.
One or more options are correct. Tick all the correct ones: a wrong option costs marks, and a part-right answer earns part of the marks.