def countdown_total(n): if type(n) is not int or n < 0: raise ValueError("Expected a nonnegative integer") if n == 0: return 0 return n + countdown_total(n - 1) print(countdown_total(4)) print(countdown_total(0))