VKI tried this for the sum_of_first_n_nos def sum_of_first_n_nos ( n ): return sum_acc( 0 , n) def sum_acc ( acc, n ): if n == 0 : return acc return sum_acc(n + acc, n - 1 ) if __name__ == "__main__" : print(sum_of_first_n_nos( 5 )) Output: 15Comment·Article·Apr 21, 2022·Recursion Part 5: Exercises in tail recursion