diff --git a/Madlibs/README.md b/Madlibs/README.md new file mode 100644 index 00000000..074cf7d6 --- /dev/null +++ b/Madlibs/README.md @@ -0,0 +1,35 @@ + +![Star Badge](https://img.shields.io/static/v1?label=%F0%9F%8C%9F&message=If%20Useful&style=style=flat&color=BC4E99) +![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103) + +# Mad Libs Game + + + + +## 🛠️ Description + +Mad Libs is a phrasal template word game. The player has to enter a set of words to substitute for blanks before knowing the story. + +## ⚙️ Languages or Frameworks Used + +The only module required is random. You can install it using +```pip install random``` + +## 🌟 How to run + +It is really simple to run the game. Simple head over to the directory where python file is saved and run the following command: +```python madlibs.py``` + +## 📺 Demo +![Screenshot_madlibs](https://user-images.githubusercontent.com/68545365/128495675-6f72cc4f-2a0f-4bdc-b1a1-18c60f37cd5d.png) + + +## 🤖 Author + +Shruti Solani diff --git a/Madlibs/madlibs.py b/Madlibs/madlibs.py new file mode 100644 index 00000000..07b68a24 --- /dev/null +++ b/Madlibs/madlibs.py @@ -0,0 +1,23 @@ +import random +print("Title : Eat, Drink, And Be Sick") +noun = [] +for i in range(4): + n = input("Enter noun : ") + noun.append(n) +plural = [] +for i in range(6): + pn = input("Enter plural noun : ") + plural.append(pn) +adjective = [] +for i in range(2): + a = input("Enter adjective : ") + adjective.append(a) +adverb = input("Enter adverb : ") +letter = input("Enter any letter : ") +body_part = input("Enter any body part : ") +print("An inspector from the Department of Health and ", random.choice(noun) , " Services paid a surprise visit to our " , random.choice(adjective) , " school cafeteria.") +print("The lunch special, prepared by our " , random.choice(adjective) , "dietician, was spaghetti and " , random.choice(noun) , " balls with a choice of either a " , random.choice(noun) , " salad or French " , random.choice(plural) , ".") +print("The inspector found the meat-" , random.choice(plural) , " to be overcooked and discovered a live " , random.choice(noun) , " in the fries,causing him to have a " + body_part + " ache.") +print("In response, he threw up all over his " , random.choice(plural) , ".") +print("In his report, the inspector " + adverb + " recommended that the school cafeteria serve only nutritious " , random.choice(plural) , " as well as low-calorie " , random.choice(plural) , " and that all of the saturated " , random.choice(plural) , " be eliminated.") +print("He rated the cafeteria a " + letter + "-minus.") diff --git a/Number Guessing/README.md b/Number Guessing/README.md new file mode 100644 index 00000000..927477a1 --- /dev/null +++ b/Number Guessing/README.md @@ -0,0 +1,35 @@ + +![Star Badge](https://img.shields.io/static/v1?label=%F0%9F%8C%9F&message=If%20Useful&style=style=flat&color=BC4E99) +![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103) + +# Number Guessing + +![number_guessing](https://user-images.githubusercontent.com/68545365/128492288-5fe26cef-5961-4c93-9908-ee8d69b4dd11.gif) + + +## 🛠️ Description + +This is a simple game where you have to guess a computer generated number within 1 to 10. However, you can't guess it all. You have only 4 chances to guess the correct number. + +## ⚙️ Languages or Frameworks Used + +The only python module that is required is random. +You can install it using ```pip install random``` + +## 🌟 How to run + +Running the script is really simple! Just open a terminal in the folder where your script is located and run the following command: +```python number_guessing.py``` + +## 📺 Demo +![Screenshot 2021-08-06 153013](https://user-images.githubusercontent.com/68545365/128493914-936c4140-35ff-4fc6-9b5b-3f5c3f4cdc2a.png) + + +## 🤖 Author + +Shruti Solani diff --git a/Number Guessing/number_guessing.py b/Number Guessing/number_guessing.py new file mode 100644 index 00000000..c12b04d9 --- /dev/null +++ b/Number Guessing/number_guessing.py @@ -0,0 +1,25 @@ +import random, time +print("Welcome to number guessing game !!!") +time.sleep(2) +#generate a random number +x = random.randint(1, 10) +print("The number is generated!!!") +time.sleep(1) +print("You have 4 chances to guess") +#initialize the counter +count = 4 +while count != 0: + a = int(input("Guess the number : ")) + #if number guessed is correct, print correct + if a == x: + print("You are right, correct number is ", x) + print("Congratulations! You won") + break + #if guessed number is greater + elif a > x: + print("The number is less than ", a) + #if guessed number is smaller + else: + print("The number is greater than ", a) + #decrease the counter after each guess + count -= 1 diff --git a/README.md b/README.md index a32880cc..c8827158 100644 --- a/README.md +++ b/README.md @@ -198,7 +198,8 @@ SR No | Project | Description | Author 9 | [Smart Calculator](https://github.com/ndleah/python-mini-project/tree/main/Smart_Calculator) | A smart calculator using for basic math equations, built by using python. | [Leah Nguyen](https://github.com/ndleah) 10 | [Screenpet](https://github.com/ndleah/python-mini-project/tree/main/Screenpet) | A cute screenpet having different reactions when interact on desktop. | [Leah Nguyen](https://github.com/ndleah) 11 | [Egg Catcher](https://github.com/ndleah/python-mini-project/tree/main/Egg_Catcher) | Egg catcher game built in using Python. | [Leah Nguyen](https://github.com/ndleah) - +12 | Number Guessing | Number Guessing Game | [Shruti Solani](https://github.com/ShrutiSolani) +13 | Mad Libs | Mad Libs Game | [Shruti Solani](https://github.com/ShrutiSolani) ## ![image](IMG/muscle.svg) Feedback If you have any feedback or ideas to improve this project, feel free to contact me via