``` # 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) ```
author | python-dev |
---|---|
permlink | python-program-to-find-the-factorial-of-a-number |
category | python-dev |
json_metadata | {"tags":["python-dev"],"app":"hiveblog/0.1","format":"markdown"} |
created | 2020-03-22 09:54:42 |
last_update | 2020-03-22 09:54:42 |
depth | 0 |
children | 1 |
last_payout | 2020-03-29 09:54:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.125 HBD |
curator_payout_value | 0.125 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 513 |
author_reputation | 5,457,648,648,750 |
root_title | "Python Program to Find the Factorial of a Number" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 96,537,282 |
net_rshares | 846,483,380,542 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
xiguang | 0 | 216,515,816,236 | 100% | ||
python-dev | 0 | 738,028,114 | 100% | ||
crypto.income | 0 | 629,229,536,192 | 44% |
[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.
author | steemcleaners |
---|---|
permlink | q7v2q1 |
category | python-dev |
json_metadata | {"links":["http://www.plagiarism.org/plagiarism-101/what-is-plagiarism/"],"app":"hiveblog/0.1"} |
created | 2020-03-27 16:49:15 |
last_update | 2020-03-27 16:49:15 |
depth | 1 |
children | 0 |
last_payout | 2020-04-03 16:49:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.464 HBD |
curator_payout_value | 0.464 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 368 |
author_reputation | 2,789,224,428,782,668 |
root_title | "Python Program to Find the Factorial of a Number" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 96,602,928 |
net_rshares | 3,412,024,459,845 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
adm | 0 | 2,063,306,513,653 | 9.5% | ||
sc-fund | 0 | 68,265,740,601 | 12.5% | ||
bdvoter | 0 | 1,280,452,205,591 | 2% |