Generate a list of n consecutive composite numbers ( An interesting method ) | function to find factorial of given number ; Prints n consecutive numbers . ; Driver Code
def factorial ( n ) : NEW_LINE INDENT res = 1 ; NEW_LINE for i in range ( 2 , n + 1 ) : NEW_LINE INDENT res *= i ; NEW_LINE DEDENT return res ; NEW_LINE DEDENT def printNComposite ( n ) : NEW_LINE INDENT fact = factorial ( n + 1 ) ; NEW_LINE for i in range ( 2 , n + 2 ) : NEW_LINE INDENT print ( fact + i , end = " ▁ " ) ; NEW_LINE DEDENT DEDENT n = 4 ; NEW_LINE printNComposite ( n ) ; NEW_LINE