3. Factorial a) Define a function named factorial() with a parameter n. This function returns the product of all values from n to 1 inclusive. This is known as n! or n*n-1*n-2*n-3*n-4... until n...


Python


3. Factorial<br>a) Define a function named factorial() with a parameter n.<br>This function returns the product of all values from n to 1 inclusive.<br>This is known as n! or n*n-1*n-2*n-3*n-4... until n reaches 1.<br>For example: 5! is 5*4*3*2*1 = 120<br>b) Define a main() function to do the following:<br>1) Request an integer value num from the console.<br>2) Call factorial() with num as an argument.<br>c) Call main() function to initiate the tasks to be performed.<br>Example Output<br>Enter an integer value: 5<br>5! is 120<br>

Extracted text: 3. Factorial a) Define a function named factorial() with a parameter n. This function returns the product of all values from n to 1 inclusive. This is known as n! or n*n-1*n-2*n-3*n-4... until n reaches 1. For example: 5! is 5*4*3*2*1 = 120 b) Define a main() function to do the following: 1) Request an integer value num from the console. 2) Call factorial() with num as an argument. c) Call main() function to initiate the tasks to be performed. Example Output Enter an integer value: 5 5! is 120

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here