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_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 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..2d80b4d --- /dev/null +++ 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 new file mode 100644 index 0000000..840792b --- /dev/null +++ b/Day-02-Number-Guesser/number_guess.py @@ -0,0 +1,26 @@ +ο»Ώ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 🀏") + break + 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