Using Python programming, define a function named factorial that takes a non-negative integer as a parameter and returns the factorial of that number. Solve this by using a for loop.
def factorial(n1):
result = 1
for x in range(2, n1 + 1):
result *= x
return result
# Testing
def main():
n = int(input("Enter value for n: "))
print(factorial(n))
main()


Using Python programming, define a function named factorial that takes a non-negative integer as a parameter...