@BenTerry/

Number Guessing Game-4

Python

this repl is for the absolute mad lads or the road men of the 19th century

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#First letter of firstname and then 1st and last letter of surname.
firstname1 = input("What is your first name? ")
surname1 = input("What is your surname? ")

#The letters of part of a name
userID1 = firstname1[0]
userID2 = surname1[0]
userID3 = surname1[-1:]
#Random number generator
print(userID1,userID2,userID3)
num1 = input("Guess what number I am thinking of ? ")
import random
z = 1
x = random.randint(0, 9)
print("I am thinking of a number between 1 and 10.")
y = int(input("Can you guess what it is? Enter your guess: "))
print("")
while z != 0:
  if y > x:
    y = int(input("Too high. Try again: "))
    z += 1
  elif y < x:
    y = int(input("Too low. Try again: "))
    z += 1
  else:
    print("Well done you figured out the number do you want a medel, because your not getting one")
    break
print("You took", z, "guesses to figure it out.")