CJCoding With Joseph
15free / daySign inCreate account
← Back to Question List
Python Code Walkthrough #45

Watching Factorial Descend

easyRecursion

📄 Code

Read carefully — what does this print?
1def factorial(n: int) -> int:
2 print("call", n)
3 if n <= 1:
4 return 1
5 return n * factorial(n - 1)
6 
7print(factorial(4))

🎯 Your Answer