# Arup Guha
# 1/29/2020
# Guessing Game

import random

def main():

    # The secret number to guess.
    secret = random.randint(1, 100)

    # will store the user's guess.
    guess = -1

    # Keeps track of how many guesses are made.
    num_guesses = 0

    # Keep going until they guess the number.
    while guess != secret:

        # Get the next guess, update guess counter.
        guess = int(input("What do you think the number is?\n"))
        num_guesses += 1

        # Print appropriate message based on if guess is too low or high.
        if guess < secret:
            print("Sorry that guess is too low. Try again.")
        elif guess > secret:
            print("Sorry that guess is too high. try again.")

    # Ending message.
    print("Congrats you got the number in",num_guesses,"guesses.")

# Run it.
main()
