How to make factoral program in …
CBSE, JEE, NEET, CUET
Question Bank, Mock Tests, Exam Papers
NCERT Solutions, Sample Papers, Notes, Videos
Posted by Chetan Gulia 5 years, 7 months ago
- 1 answers
Related Questions
Posted by Hanni Pham 4 months, 2 weeks ago
- 1 answers
Posted by Syedali Fathima 5 months, 3 weeks ago
- 1 answers
Posted by Hanni Pham 4 months, 2 weeks ago
- 0 answers
Posted by Kandeepan Jothivel 6 months, 3 weeks ago
- 2 answers
Posted by Priya Shukla 5 months, 3 weeks ago
- 1 answers
Posted by Prawar Narang 6 months, 2 weeks ago
- 1 answers
Posted by Manoj Kumar Manoj Kumar 7 months, 2 weeks ago
- 0 answers
myCBSEguide
Trusted by 1 Crore+ Students
Test Generator
Create papers online. It's FREE.
CUET Mock Tests
75,000+ questions to practice only on myCBSEguide app
Khushbu Garg 5 years, 7 months ago
Python program to find the factorial of a number provided by the user.
# change the value for a different result
num = 8
# uncomment to take input from the user
#num = int(input("Enter a number: "))
factorial = 1
# check if the number is negative, positive or zero
if num < 0:
print("Sorry, factorial does not exist for negative numbers")
elif num == 0:
print("The factorial of 0 is 1")
else:
for i in range(1,num + 1):
factorial = factorial*i
print("The factorial of",num,"is",factorial)
1Thank You