I am doing factorial problem and getting this error message:
Runtime Error
Hangup (SIGHUP)
Traceback (most recent call last):
File "Solution.py", line 24, in <module>
for i in ans:
TypeError: 'int' object is not iterable
this is my code
class Solution:
def factorial(self, N):
if N == 1:
return 1
else:
return N * self.factorial(N - 1)
New contributor
Pari is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.