Hello From Python

A simple line of code written using python.

print("Hello World")
Hello World

The Game

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!")
Welcome to Guess My Number!
50
Too low!
60
Too high!
55
Too high!
55
Too high!
54
Too high!
53
Too high!
51
Too low!
52
You are correct!
You took 8 guesses!