Can anyone point out why this code is not working to solve factorial? I tryed it o IDLE and it is returning correctly. But not on Codecademy environment.
link to the excercise: https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/0/5?curriculum_id=4f89dab3d788890003000096
Codecademy returns: Oops, try again.
factorial(3) returned 12 instead of 6
total = 1 def factorial(n): n = int(n) n = abs(n) global total if n == 0: return 1 elif n == 1: return total else: total = total * n n = n - 1 return factorial(n)