From f34799ad3046282861008debcf1dacbe60450182 Mon Sep 17 00:00:00 2001 From: oluwatomisin780 Date: Thu, 5 Oct 2023 11:29:07 +0100 Subject: [PATCH] python_factorial --- README.md | 39 +++++++++++++++++++++++++-------------- python/factorial.py | 11 +++++++++++ 2 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 python/factorial.py diff --git a/README.md b/README.md index 04699cc..684ba37 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,63 @@ # Algorithms-HacktoberFest + Write Algorithm in any language and contribute to HacktoberFest -# Table of Algorithms +# Table of Algorithms `B` - Beginner, `A` - Advanced -## JavaScript -* `B` [Factorial](javascript/factorial.js) +## JavaScript + +- `B` [Factorial](javascript/factorial.js) + +--- ------------------ ## C++ -* `B` [Factorial](C++/factorial.js) ------------------ ----------------- +- `B` [Factorial](C++/factorial.js) + +## python + +- `B` [Factorial](python/factorial.py) + +--- + +--- ### Get yourself free goodies by just writing an algorithm in your language of choice -Write a pre existing algo in any language of your choice! +Write a pre existing algo in any language of your choice! # What is Hacktoberfest? + Hacktoberfest is a program by Digital Ocean and Github, where you can easily win a T-Shirt just by making 5 pull requests in the month of October to any open source projects on Github. ## Steps to follow :scroll: ### 1. Register for Hacktoberfest + You can register from [here](https://hacktoberfest.digitalocean.com). ### 2. Fork it :fork_and_knife: You can get your own fork/copy of [Hello-world](https://github.com/piyush97/Algorithms-HacktoberFest) by using the Fork button or clicking [this](https://github.com/piyush97/Hacktoberfest/). - [![Fork Button](https://help.github.com/assets/images/help/repository/fork_button.jpg)](https://github.com/piyush97/Algorithms-HacktoberFest) +[![Fork Button](https://help.github.com/assets/images/help/repository/fork_button.jpg)](https://github.com/piyush97/Algorithms-HacktoberFest) ### 3. Add a Program in any Language you like :rabbit2: -Once you have forked the repo, add your progam in the language folder in + +Once you have forked the repo, add your progam in the language folder in main branch, if there is no language folder, make one, then add into it. You can take a look to the [Programming Language List](https://en.wikipedia.org/wiki/List_of_programming_languages) in Wikipedia to create a new one Hacktoberfest ! ### 4. Ready, Steady, Go... :turtle: :rabbit2: -Once you have completed these steps, you are ready to start contributing +Once you have completed these steps, you are ready to start contributing by checking our `Help Wanted` issues and creating [pull requests](https://github.com/piyush97/Algorithms-HacktoberFest/pulls). ### 5. Give this Project a Star :star: -If you liked working on this project, please share this project as much +If you liked working on this project, please share this project as much as you can and star this project to help as many people in opensource as you can. - -:tada: :confetti_ball: :smiley: _**Happy Contributing**_ :smiley: :confetti_ball: :tada: +:tada: :confetti*ball: :smiley: ***Happy Contributing**\_ :smiley: :confetti_ball: :tada: diff --git a/python/factorial.py b/python/factorial.py new file mode 100644 index 0000000..9be9dc8 --- /dev/null +++ b/python/factorial.py @@ -0,0 +1,11 @@ + +#factoral function + +n=int(input("Enter number")) +fact =1 + +for i in range(1, n+1): + fact = fact * i + +print("The factorial of 23 is : ", end="") +print(fact) \ No newline at end of file