Gadgets 4 Students Online Courses
Free Tutorials  Go to Your University  Placement Preparation 
1 like 0 dislike
8.9k views
in Python Programming by Goeduhub's Expert (9.0k points)

Where can I do online courses From Word's Top Instructors?

UDEMY::  Attend All Udemy Courses in Just INR 450[Coupon]
Coursera:: Join For FREE

1 Answer

1 like 0 dislike
by Goeduhub's Expert (9.0k points)
 
Best answer

num = int(input())

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) 

Code your future with Programming skills. Courses starting at ₹ 455 only!

3.3k questions

7.1k answers

395 comments

4.5k users

Related questions

 Important Lists:

Important Lists, Exams & Cutoffs Exams after Graduation PSUs

 Goeduhub:

About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © goeduhub.com Social::   |  | 

 

Free Online Directory
...