initial commit
This commit is contained in:
commit
39f56a3b10
83 files changed
+3583
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import random
|
||||
|
||||
|
||||
def gamble():
|
||||
counter = 0
|
||||
print("in this game you have to guess a random number between 1 and 100")
|
||||
target = int(random.randint(1,100))
|
||||
while True:
|
||||
guess = int(input("Take a guess! : "))
|
||||
if target == guess:
|
||||
print("You won!")
|
||||
print("guesses taken: ",counter)
|
||||
break
|
||||
if target > guess:
|
||||
print("too low")
|
||||
if target < guess:
|
||||
print("too high")
|
||||
counter = counter+1
|
||||
|
||||
gamble()
|
||||
Reference in new issue
Block a user