def factorial(n): result = 1 for x in range(1,___): result = ___ * ___ return ___ for n in range(___,___): print(n, factorial(n+___))
Answers
Answered by
5
Explanation:
hey mate
solution:
def factorial (n):
result=1
for x in range (1,n+1):
result=result*x
return result
for n in range(1,<stop value>):
print(n, factorial (n))
IMPORTANT: i have left the stop value of the for loop as it should be given by the the user!!
PURPOSE: the above program intends to calculate the factorial of the numbers till that number and return it as (number, factorial) pair.
SOME ADDITIONAL INFORMATION:
factorial refers to the continuous multiplication of of the number starting from 1.it is denoted by ! symbol.
e.g, 5!=120
Attachments:
Similar questions
Science,
5 months ago
Hindi,
5 months ago
English,
11 months ago
Computer Science,
1 year ago
Math,
1 year ago