def calc_fact(n):
if (n == 1 or n == 0):
return 1
else:
n * calc_fact(n-1)
print(calc_fact(5))
Was trying to create function to calculate factorial facing type error operand not supported *: for int or Nonetype i do not know why thanks
New contributor
Mudasir Ahmed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.