diff --git a/README.md b/README.md index 3453fa8..b82d3c4 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,35 @@ -# Simple Programs in Python -Some short and simple python programs - -### Contributing Guidelines -1. You can add any complete python program or correct/improvise existing one. -2. Please have a look at exisiting programs and make sure you're not repeating. -3. Add your program and one line description to the following table with your name. -- Add your name in the format : <[YourName]><(link to profile)> -- Add your program name in the format : <[YourProgramName]><(link to program)> -(Add link after your first PR is merged!) -4. Make a fork and start PR from there. Do not create branches on original repository. -5. Please follow rightful code of conduct be polite to others. - -Thanks! - -### Programs list -*When adding your name, don't add it at the beginning or end of the file. Put it anywhere in between* - -| Name | Description | Contributor | -| -------- | -------- | -------- | -| [TicTacToe.py](https://github.com/accakks/Simple-Programs-in-Python/blob/master/TicTacToe.py) | 2 Player Tic Tac Toe | [Aakanksha](https://github.com/accakks) | -| [RockPaperScissors.py](https://github.com/accakks/Simple-Programs-in-Python/blob/master/RockPaperScissors.py) | Rock Paper Scissors with Computer | [Aakanksha](https://github.com/accakks) | -| [countCharacter.py](https://github.com/accakks/Simple-Programs-in-Python/blob/master/countCharacter.py) | Counts number of times each character occurs in the input string. | [Aakanksha](https://github.com/accakks) | -| [calculatePi.py](https://github.com/accakks/Simple-Programs-in-Python/blob/master/calculatePi.py) | Calculates PI to a specified number of digits of accuracy. | [Joseph-Acevedo](https://github.com/joseph-acevedo) | -| [mp3_duration.py](https://github.com/srbilla/Simple-Programs-in-Python/blob/master/mp3_duration.py) | Returns the duration of mp3 file | [Santhosh](https://github.com/srbilla) | -[sixers.py] () | Calculates number of days until the next 76ers game this month | [Sabrina Koehler] (https://github.com/sabrinakoehler)| -|koch_snowflake.py | Draw a Koch snowflake fractal with Turtle module | [Lenart Bucar](https://github.com/LenartBucar) -|Quine.py | Quine of python | [Xiao Tan](https://github.com/tvytlx) -| [powerDigitSum.py](--) | Adds the sum of the digits of 2 raised to a given number. | [Beatriz](https://github.com/tris-rivers) | -|koch_snowflake.py | Draw a Koch snowflake fractal with Turtle module | [Lenart Bucar](https://github.com/LenartBucar) -| [CircleDrawer.py](https://github.com/accakks/Simple-Programs-in-Python/blob/master/CircleDrawer.py)| draws a green circle in the middle of the screen. | [wolfEXE57](https://github.com/wolfEXE57) -|batch_rename.py | Batch rename files in a directory using custom logic | [Anmol Singh Jaggi](https://github.com/anmol-singh-jaggi) -|net_job_creation.py | Query US Census Bureau for job creation data (1980 - 2014) | [DnrkasEFF](https://github.com/DnrkasEFF) - +# Simple Programs in Python +Some short and simple python programs + +### Contributing Guidelines +1. You can add any complete python program or correct/improvise existing one. +2. Please have a look at exisiting programs and make sure you're not repeating. +3. Add your program and one line description to the following table with your name. +- Add your name in the format : <[YourName]><(link to profile)> +- Add your program name in the format : <[YourProgramName]><(link to program)> +(Add link after your first PR is merged!) +4. Make a fork and start PR from there. Do not create branches on original repository. +5. Please follow rightful code of conduct be polite to others. + +Thanks! + +### Programs list +*When adding your name, don't add it at the beginning or end of the file. Put it anywhere in between* + +| Name | Description | Contributor | +| -------- | -------- | -------- | +| [TicTacToe.py](https://github.com/accakks/Simple-Programs-in-Python/blob/master/TicTacToe.py) | 2 Player Tic Tac Toe | [Aakanksha](https://github.com/accakks) | +| [RockPaperScissors.py](https://github.com/accakks/Simple-Programs-in-Python/blob/master/RockPaperScissors.py) | Rock Paper Scissors with Computer | [Aakanksha](https://github.com/accakks) | +| [countCharacter.py](https://github.com/accakks/Simple-Programs-in-Python/blob/master/countCharacter.py) | Counts number of times each character occurs in the input string. | [Aakanksha](https://github.com/accakks) | +| [calculatePi.py](https://github.com/accakks/Simple-Programs-in-Python/blob/master/calculatePi.py) | Calculates PI to a specified number of digits of accuracy. | [Joseph-Acevedo](https://github.com/joseph-acevedo) | +| [mp3_duration.py](https://github.com/srbilla/Simple-Programs-in-Python/blob/master/mp3_duration.py) | Returns the duration of mp3 file | [Santhosh](https://github.com/srbilla) | +[sixers.py] () | Calculates number of days until the next 76ers game this month | [Sabrina Koehler] (https://github.com/sabrinakoehler)| +|koch_snowflake.py | Draw a Koch snowflake fractal with Turtle module | [Lenart Bucar](https://github.com/LenartBucar) +|Quine.py | Quine of python | [Xiao Tan](https://github.com/tvytlx) +| [powerDigitSum.py](--) | Adds the sum of the digits of 2 raised to a given number. | [Beatriz](https://github.com/tris-rivers) | +|koch_snowflake.py | Draw a Koch snowflake fractal with Turtle module | [Lenart Bucar](https://github.com/LenartBucar) +| [CircleDrawer.py](https://github.com/accakks/Simple-Programs-in-Python/blob/master/CircleDrawer.py)| draws a green circle in the middle of the screen. | [wolfEXE57](https://github.com/wolfEXE57) +|batch_rename.py | Batch rename files in a directory using custom logic | [Anmol Singh Jaggi](https://github.com/anmol-singh-jaggi) +|net_job_creation.py | Query US Census Bureau for job creation data (1980 - 2014) | [DnrkasEFF](https://github.com/DnrkasEFF) +|countWord.py | Count words in a given period. | [Drunpy](https://github.com/Drunpy) + diff --git a/countWord.py b/countWord.py new file mode 100644 index 0000000..1c2642c --- /dev/null +++ b/countWord.py @@ -0,0 +1,11 @@ +text = str(input('Paste some text: \n')) + +wordlist = {} +spltxt = text.split(' ') +for word in spltxt: + word = word.lower() + if word not in wordlist: + wordlist[word] = 1 + else: + wordlist[word] += 1 +print(wordlist) \ No newline at end of file