Markdown_table_code_hack_ipynb_2_
import random
def guess_the_number():
secret_number = random.randint(1, 100)
attempts = 0
print("Welcome to the Number Guessing Game!")
print("I'm thinking of a number between 1 and 100.")
while True:
user_guess = int(input("Take a guess: "))
attempts += 1
if user_guess < secret_number:
print("Too low! Try again.")
elif user_guess > secret_number:
print("Too high! Try again.")
else:
print(f"Congrats! You've guessed the number {secret_number} in {attempts} tries.")
break
guess_the_number()