Skip to content

Instantly share code, notes, and snippets.

@kbatchelli
Last active July 14, 2024 20:29
Show Gist options
  • Save kbatchelli/a4c540f02348477324c75c6611a68a67 to your computer and use it in GitHub Desktop.
Save kbatchelli/a4c540f02348477324c75c6611a68a67 to your computer and use it in GitHub Desktop.
g.v.1.4.py
import random
max_score=100
max_scorer=""
while True:
print("Top score: %d by %s" % (max_score,max_scorer))
name = input("what’s your name?")
print("hello %s" % name)
answer = random.randint(1,100)
guess=0
n_guesses=0
print("You are now playing the number guessing game v.1.4 whats your guess?")
while (guess != answer):
n_guesses=n_guesses+1
guess = int(input("enter your guess num. %d: " % n_guesses))
if guess == answer:
print("Yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay!")
break
elif guess < answer:print("Too low.")
elif guess > answer:print("Too high.")
if (n_guesses<max_score):
max_score=n_guesses
max_scorer=name
@kbatchelli
Copy link
Author

This is a any-amount-of-players number guessing game.

@kbatchelli
Copy link
Author

@kbatchelli
Copy link
Author

this is python 3.4

@caselala
Copy link

scenario

@desenvolvedorIcotrade
Copy link

#{{}=-o-mi_)
{g;lçP^^PPPP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment