mirror of
				https://github.com/onyx-and-iris/grokking-algorithms.git
				synced 2025-11-04 06:21:46 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			8 lines
		
	
	
		
			159 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			8 lines
		
	
	
		
			159 B
		
	
	
	
		
			Python
		
	
	
	
	
	
def factorial(x):
 | 
						|
    if x == 1:  # This is the base case
 | 
						|
        return 1
 | 
						|
    return x * factorial(x - 1)  # This is the recursive case
 | 
						|
 | 
						|
 | 
						|
print(factorial(4))
 |