create account

Python Program to Find the Factorial of a Number by python-dev

View this thread on: hive.blogpeakd.comecency.com
· @python-dev ·
$0.25
Python Program to Find the Factorial of a Number
``` 
# Python program to find the factorial of a number provided by the user.

# change the value for a different result
num = 7

# 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)
 ```
👍  , ,
properties (23)
authorpython-dev
permlinkpython-program-to-find-the-factorial-of-a-number
categorypython-dev
json_metadata{"tags":["python-dev"],"app":"hiveblog/0.1","format":"markdown"}
created2020-03-22 09:54:42
last_update2020-03-22 09:54:42
depth0
children1
last_payout2020-03-29 09:54:42
cashout_time1969-12-31 23:59:59
total_payout_value0.125 HBD
curator_payout_value0.125 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length513
author_reputation5,457,648,648,750
root_title"Python Program to Find the Factorial of a Number"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id96,537,282
net_rshares846,483,380,542
author_curate_reward""
vote details (3)
@steemcleaners ·
$0.93
[Plagiarism](http://www.plagiarism.org/plagiarism-101/what-is-plagiarism/) is the copying & pasting of others work without giving credit to the original author or artist. Plagiarized posts are considered fraud and violate the intellectual property rights of the original creator. 

Fraud is discouraged by the community and may result in the account being Blacklisted.
👍  , ,
properties (23)
authorsteemcleaners
permlinkq7v2q1
categorypython-dev
json_metadata{"links":["http://www.plagiarism.org/plagiarism-101/what-is-plagiarism/"],"app":"hiveblog/0.1"}
created2020-03-27 16:49:15
last_update2020-03-27 16:49:15
depth1
children0
last_payout2020-04-03 16:49:15
cashout_time1969-12-31 23:59:59
total_payout_value0.464 HBD
curator_payout_value0.464 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length368
author_reputation2,789,224,428,782,668
root_title"Python Program to Find the Factorial of a Number"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id96,602,928
net_rshares3,412,024,459,845
author_curate_reward""
vote details (3)