@BenTerry/

Number Guessing Game-6

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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#First letter of forename. Firstname1 is a variable for your firstname. Then userID1 is a variable for 1st letter of firstname.
firstname1 = input("What is your first name?:")
surname1 = input("What is your surname?:")
userID1 = firstname1[0]
print(userID1)

#first letter of surname. surname1 is a variable for your surname. Then userID2 is a variable for the first letter of your surname.
userID2 = surname1[0]
print(userID2)

#Last letter of surname. surname1 is a variable for your surname. Then userID3 is the last letter of the surname. It is -1 because negative 0 is not a number.
userID3 = surname1[-1:]
print(userID3)

#Number Generator
num1 = input("Guess what number i'm thinking of?")
import random
num2 = random.randint(0,9)
if num2 == num1:
  print("you got 1 point")

else: 
  print ("you didn't get a point")
  print()
  print("Please try again")

#second try
num1 = input("Guess what number i'm thinking of?")
import random
num2 = random.randint(0,9)
if num2 == num1:
  print("you got 1 point")

else: 
  print ("you didn't get a point")
  print()
  print("Please try again")

#third try
num1 = input("Guess what number i'm thinking of?")
import random
num2 = random.randint(0,9)
if num2 == num1:
  print("you got 1 point")

else: 
  print ("you didn't get a point")
  print()
  print("Please try again")

#fourth try
num1 = input("Guess what number i'm thinking of?")
import random
num2 = random.randint(0,9)
if num2 == num1:
  print("you got 1 point")

else: 
  print ("you didn't get a point")
  print()
  print("Please try again")