human
One line function for factorial of a number | Python3 program to find factorial of given number.
single line to find factorial.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to one line function for factorial of a number and the other steps required.
 def factorial ( n ) :
	return 1 if ( n == 1 or n == 0 ) else n * factorial ( n - 1 ) ;
num = 5 ;
print ( " Factorial ▁ of " , num , " is " , factorial ( num ) ) ;