Play Guess My Number!
A simple game using Python.
print("Hello World")
import random
print("Welcome to Guess My Number!")
secret_number = random.randint(1,100)
num_guesses = 0
while True:
current_guess = int(input("What is your guess?"))
# num_guesses = num_guesses +1
num_guesses += 1
print(current_guess)
if current_guess == secret_number:
print("You are correct!")
break
elif current_guess < secret_number:
print("Too low!")
elif current_guess > secret_number:
print("Too high!")
print(f"You took {num_guesses} guesses!")