Python program to find the factorial of a number using recursion
Looking over your code, this is what I have for you:


Your function can be turned into a one-liner
You should use if __name__ == '__main__' to ensure you're not running this program externally.


Refactored Code:

def recur_factorial(x):
  return 1 if x == 1 else (x * recur_factorial(x - 1))

def main():
  num = int(input("Enter number: "))
  print("The factorial of", num, "is", recur_factorial(num))

if __name__ == '__main__':
  main()


You can read this StackOverflow question for more information about the advantages and disadvantages of recursion