def Quiz():
print("Quiz Time!")
count = 0
ans1 = int(input("What is 2 + 4? "))
if(ans1 == 6):
count += 1
print("Correct!")
else:
print("Incorrect.")
ans2 = input("What city is the Statue of Liberty in? ")
if(ans2 == "New York"):
count += 1
print("Correct!")
else:
print("Incorrect.")
ans3 = input("Which country has the largest population in the world? ")
if(ans3 == "China"):
count += 1
print("Correct!")
else:
print("Incorrect.")
ans4 = input("How many strings does a violin have? ")
if(ans4 == "Four" or ans4 == "four" or ans4 == "4"):
count += 1
print("Correct!")
else:
print("Incorrect.")
ans5 = input("How many Toy Story films are there?\nA.1\nB.2\nC.3\nD.4\n")
if(ans5 == "D" or ans5 == "d"):
count += 1
print("Correct!")
else:
print("Incorrect")
print("Congratulations, you got " + str(count) + " answers right.")
print("That is a score of " + str(count*20) + " percent.")
#Quiz()
def GuessingGame():
print("Game LOADING...")
lowerbond = int( input("What is the lower bond of the number? \n") )
upperbond = int( input("What is the upper bond of the number? \n") )
print("Generating a random number between "+str(lowerbond)+" - "+str(upperbond)+"......")
import random
number = random.randint(lowerbond,upperbond)
tries = int(input("How many tries for the player to win? \n") )
print("GAME READY. Now let's play!")
name = input("Hello, what's your name? \n")
print("Hi "+name+" you are going to guess a number between "+str(lowerbond)+" and "+str(upperbond)+". ")
print("You have " + str(tries) + " tries to win the game. ")
i=1
while(i<=tries):
guess = int(input("Your " + str(i) + " guess is: "))
if( guess == number ):
print("You win the game in "+ str(i) +" tries!")
break
elif( guess > number ):
print("Your guess is too high.")
else:
print("Your guess is too low.")
i=i+1
GuessingGame()