From c1fb2f48dbbaa0f59c14eee3de1f5963f4fd42e4 Mon Sep 17 00:00:00 2001 From: shouryaAr <72160182+shouryaAr@users.noreply.github.com> Date: Thu, 15 Oct 2020 15:18:27 +0530 Subject: [PATCH] Create GuessingGame.py Made A New And Simple Game. --- Python/Python_Games/GuessingGame.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Python/Python_Games/GuessingGame.py diff --git a/Python/Python_Games/GuessingGame.py b/Python/Python_Games/GuessingGame.py new file mode 100644 index 0000000..486a094 --- /dev/null +++ b/Python/Python_Games/GuessingGame.py @@ -0,0 +1,13 @@ +import random + +x = random.randint(1,10) + +while True: + user_input = int(input("Guess A Number:")) + if user_input == x: + print("Hurray! You Got It Right") + break + elif user_input > x: + print("Too High, Guess A little Lower Number") + elif user_input < x: + print("Too Low, Guess A little Higher Number")