import random
print(" Welcome to the guess my number")
print("I'm thinking of a number between 1 and 50")
print(" Welcome to the guess my number")
print("try guessing in 10 attempts")
num=random.randint(1,50)
guess = int(input())
tries = 1
while guess != num and tries !=10:
if tries ==3:
print ("Do you even have a brain?")
elif tries == 6:
print ("Wow, you are such a Dumbass!")
elif tries ==9:
print ("Buh-bye!")
if guess > num:
print("lower")
else:
print ("higher")
guess = int(input())
tries += 1
if num == guess:
print ("You guessed it!, The number is ",num,"and it took you ",tries,"tries")
else:
print ("You have failed")
Teo_1 0 Newbie Poster
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.