# The number guessing game
#
# The computer tries to guess your number within 20 tries.
# Random import
import random
# Introduction
print("\tThe Number Guessing Game")
print("\t--Created by me")
print("\n\nWelcome to the game. To play, pick a number between 1 and 100")
number = input("What is your number? ")
tries = 1
count = 1
while tries <=20 and count == 1:
guess = random.randint(1, 100)
print("\n", guess)
if guess == number:
print("\n The computer has guessed your number!")
count += 1
tries += 1
if tries <=20:
print("\nThe computer has won! It guessed, ", number)
print("Thanks for playing!")
elif tries >20:
print("\nCongratulations! You have won! The computer couldn't guess your number.")
input("\n Press Enter to exit the program")