<prompt> Kujenga kazi ambayo inachukua integer kama hoja, na magazeti nje factorical yake.  <response>: def factorialnumber: This function calculates factorial of a number :param number: Integer :return: Integer Checking if the number is a non-negative integer if typenumber ! int or number 0: printInvalid input. The number must be a non-negative integer. return result 1 while number 1: result number number - 1 printresult Examplesfactorial5 This will print 120factorial0 This will print 1factorial-5 This will print Invalid input. The number must be a non-negative integer. 