From 17ce5d5eaa0d836579f5686d8d793e3446912ccb Mon Sep 17 00:00:00 2001 From: tossy007 Date: Sun, 28 Sep 2025 15:36:08 +0530 Subject: [PATCH 1/3] feat: add Day 02 number guessing game --- .vscode/settings.json | 4 ++++ Day-01-Hello-World/main.py | 2 -- Day-02-Number-Guesser/README.md | 0 Day-02-Number-Guesser/number_guess.py | 25 +++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .vscode/settings.json delete mode 100644 Day-01-Hello-World/main.py create mode 100644 Day-02-Number-Guesser/README.md create mode 100644 Day-02-Number-Guesser/number_guess.py diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..16aa2c0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "code-runner.clearPreviousOutput": true, + "code-runner.runInTerminal": true +} \ No newline at end of file diff --git a/Day-01-Hello-World/main.py b/Day-01-Hello-World/main.py deleted file mode 100644 index 5964d8b..0000000 --- a/Day-01-Hello-World/main.py +++ /dev/null @@ -1,2 +0,0 @@ -# This is your first beginner Python program -print("Hello, World!") diff --git a/Day-02-Number-Guesser/README.md b/Day-02-Number-Guesser/README.md new file mode 100644 index 0000000..e69de29 diff --git a/Day-02-Number-Guesser/number_guess.py b/Day-02-Number-Guesser/number_guess.py new file mode 100644 index 0000000..5ca6a6f --- /dev/null +++ b/Day-02-Number-Guesser/number_guess.py @@ -0,0 +1,25 @@ +ο»Ώimport random + +number = random.randint(1 , 100) +print("Welcome to the Number Guessing Game!") + +count = 0 +while True: + X = int(input("Guess The Number (1 - 100) :")) + count += 1 + + if X < 1 or X > 100: + print("invalid Choice!!") + continue + if 1 <= X <= 15: + print("Too Close 🀏") + elif 16 <= X <= 25: + print("Try - Try πŸ€–") + elif 26 <= X <= 35: + print("You are cooked πŸ’€") + elif 36<= X <= 100: + print("You Figure out 🫷") + if X == number: + print("You Guessed It πŸš€") + print(f"It took {count} Tries 🏳️") + break \ No newline at end of file From c38141a5903809fd894cf9ef1951fa3b44385acf Mon Sep 17 00:00:00 2001 From: tossy007 Date: Tue, 30 Sep 2025 03:01:55 +0530 Subject: [PATCH 2/3] Number-guessing-game --- Day-02-Number-Guesser/README.md | 10 ++++++++++ Day-02-Number-Guesser/number_guess.py | 1 + 2 files changed, 11 insertions(+) diff --git a/Day-02-Number-Guesser/README.md b/Day-02-Number-Guesser/README.md index e69de29..2d80b4d 100644 --- a/Day-02-Number-Guesser/README.md +++ b/Day-02-Number-Guesser/README.md @@ -0,0 +1,10 @@ + +# Day02 – Number Guessing Game + +Hi! This is my second day contribution to the 30 Days – 30 Python Projects challenge. I'm building a simple number guessing game using Python to sharpen my logic and input/output skills. + +## πŸ“ Project Description +This Python script generates a random number between 1 and 100. The user is prompted to guess the number, and the program provides feedback β€” whether the guess is too high, too low, or correct. It also tracks the number of attempts. + +## πŸš€ How to Run +Make sure Python is installed, then run the script using ;) \ No newline at end of file diff --git a/Day-02-Number-Guesser/number_guess.py b/Day-02-Number-Guesser/number_guess.py index 5ca6a6f..840792b 100644 --- a/Day-02-Number-Guesser/number_guess.py +++ b/Day-02-Number-Guesser/number_guess.py @@ -13,6 +13,7 @@ continue if 1 <= X <= 15: print("Too Close 🀏") + break elif 16 <= X <= 25: print("Try - Try πŸ€–") elif 26 <= X <= 35: From 7a8b68e27b740c43ef218ab5ee84e38274e24360 Mon Sep 17 00:00:00 2001 From: tossy007 Date: Tue, 30 Sep 2025 03:04:58 +0530 Subject: [PATCH 3/3] Calculator --- DAY_03-Calculator/README.MD | 0 DAY_03-Calculator/calculator.py | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 DAY_03-Calculator/README.MD create mode 100644 DAY_03-Calculator/calculator.py diff --git a/DAY_03-Calculator/README.MD b/DAY_03-Calculator/README.MD new file mode 100644 index 0000000..e69de29 diff --git a/DAY_03-Calculator/calculator.py b/DAY_03-Calculator/calculator.py new file mode 100644 index 0000000..6ff562c --- /dev/null +++ b/DAY_03-Calculator/calculator.py @@ -0,0 +1,36 @@ +def operation(a,b,symbol): + if symbol == 1: + print(f"{a} + {b}= {a+b}") + elif symbol == 2: + print(f"{a} - {b} ={a - b}") + elif symbol == 3: + print(f"{a} X {b} = {a * b}") + elif symbol == 4: + if b==0: + print("cannot br divided") + + else: + print(f"{a} Γ· {b} = {a /b}") + + else: + print("Invalid Output") + + +value1 =int(input("Enter the Value of a :")) +value2 =int(input("Enter the Value of b :")) +print("****Enter Your Choice****") +print("1.Addition") +print("2.Subtraction") +print("3.Multiplication") +print("4.Division") +while True: + try: + sign = int(input("Enter the choice :")) + if 1 <= sign <= 4: + break # valid input, exit the loop + else: + print("Invalid input X options(1 - 4)") + except: + print("Enter Valid option") + +operation(value1,value2,sign) \ No newline at end of file