From a3c8c20312f57a7b53f30c749c5d55692d2e0c41 Mon Sep 17 00:00:00 2001 From: JACA Date: Tue, 18 Nov 2025 18:44:03 -0500 Subject: [PATCH 1/3] creation of NumGuess.py for academic activity --- NumGuess.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 NumGuess.py diff --git a/NumGuess.py b/NumGuess.py new file mode 100644 index 00000000..32e14995 --- /dev/null +++ b/NumGuess.py @@ -0,0 +1,28 @@ +import random as rd + +num = rd.randint(1, 10) + +print("Try to answer the number in 3 tries or less:") +cont = 1 +while True: + try: + entry = int(input(f"Try {cont}: ")) + break + except: + print("Introduce only a number.\n") + +while entry != num and cont < 3: + cont += 1 + print(f"wrong answer, yo have {4 - cont} tries left.\n") + while True: + try: + entry = int(input(f"Try {cont}:")) + break + except: + print("Introduce only a number.\n") + +if entry == num: + print("\nCongratulatios, you win.") + +else: + print(f"\nYou Lose, the correct answer was {num}.") \ No newline at end of file From 43c8f23c233312193e872c899d42933775b7f019 Mon Sep 17 00:00:00 2001 From: JACA Date: Tue, 18 Nov 2025 18:47:42 -0500 Subject: [PATCH 2/3] elimination NumGuess --- NumGuess.py | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 NumGuess.py diff --git a/NumGuess.py b/NumGuess.py deleted file mode 100644 index 32e14995..00000000 --- a/NumGuess.py +++ /dev/null @@ -1,28 +0,0 @@ -import random as rd - -num = rd.randint(1, 10) - -print("Try to answer the number in 3 tries or less:") -cont = 1 -while True: - try: - entry = int(input(f"Try {cont}: ")) - break - except: - print("Introduce only a number.\n") - -while entry != num and cont < 3: - cont += 1 - print(f"wrong answer, yo have {4 - cont} tries left.\n") - while True: - try: - entry = int(input(f"Try {cont}:")) - break - except: - print("Introduce only a number.\n") - -if entry == num: - print("\nCongratulatios, you win.") - -else: - print(f"\nYou Lose, the correct answer was {num}.") \ No newline at end of file From 030bbd8b2d4156c10bbe7c0db97562e9d77eb433 Mon Sep 17 00:00:00 2001 From: JACA Date: Tue, 18 Nov 2025 18:52:08 -0500 Subject: [PATCH 3/3] Guess_number problem --- Guess_number_1_to_10.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Guess_number_1_to_10.py diff --git a/Guess_number_1_to_10.py b/Guess_number_1_to_10.py new file mode 100644 index 00000000..32e14995 --- /dev/null +++ b/Guess_number_1_to_10.py @@ -0,0 +1,28 @@ +import random as rd + +num = rd.randint(1, 10) + +print("Try to answer the number in 3 tries or less:") +cont = 1 +while True: + try: + entry = int(input(f"Try {cont}: ")) + break + except: + print("Introduce only a number.\n") + +while entry != num and cont < 3: + cont += 1 + print(f"wrong answer, yo have {4 - cont} tries left.\n") + while True: + try: + entry = int(input(f"Try {cont}:")) + break + except: + print("Introduce only a number.\n") + +if entry == num: + print("\nCongratulatios, you win.") + +else: + print(f"\nYou Lose, the correct answer was {num}.") \ No newline at end of file