the function and loop will be
def factorial(x):
total = 1
if x != 1 and x != 0:
for i in range(x,1,-1):
total *= i
return total
Answer:
The four steps to defining a function in Python are the following:
Use the keyword def to declare the function and follow this up with the function name.
Add parameters to the function: they should be within the parentheses of the function. ...
Add statements that the functions should execute.
Answer:
Please check the attachment.
Explanation:
The answers are self explanatory.