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
Recommended Answers
Jump to PostThe first step is to import the GUI library you mean to use. Since a set of bindings for Tk is included with the Python standard library, that's probably the one you'll want …
All 2 Replies
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.