repl.it
@CAILEY0132790/

Lottery numbers

Python

No description

fork
loading
Files
  • main.py
  • dictionaries.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#By: Cailey Bianchini
#Subject: Lottery

lottery_numbers = {13, 21, 22, 5, 8}

print("What is your name, player one?")
PLAYER_NAME_1 = (input())

print("What is your name, player two?")
PLAYER_NAME_2 = (input())

print(" ")

print("Hello " + str(PLAYER_NAME_1) + " and " + str(PLAYER_NAME_2) + ".")

print(" ")

print(str(PLAYER_NAME_1) + ", you are to print five numbers to guess the lottery.")

print(" ")

#The following allows player to enter their guesses for the lottery
print("1. ")
numbers_1_a = int(input())

print("2. ")
numbers_2_a = int(input())

print("3. ")
numbers_3_a = int(input())

print("4. ")
numbers_4_a = int(input())

print("5. ")
numbers_5_a = int(input())

numbers_a = {(numbers_1_a), (numbers_2_a), (numbers_3_a), (numbers_4_a), (numbers_5_a)}

numbers_wrong_a = lottery_numbers.difference(numbers_a)
numbers_right_a = numbers_a.intersection(lottery_numbers)

print(" ")

print("The lottery numbers you got wrong was " + str(numbers_wrong_a) + ".")
print("You got " + str(len(numbers_right_a)) + " right.")

print(" ")

#the following is player two

print(str(PLAYER_NAME_2) + ", you are to print five numbers to guess the lottery.")

print(" ")

print("1. ")
numbers_1_b = int(input())

print("2. ")
numbers_2_b = int(input())

print("3. ")
numbers_3_b = int(input())

print("4. ")
numbers_4_b = int(input())

print("5. ")
numbers_5_b = int(input())

numbers_b = {(numbers_1_b), (numbers_2_b), (numbers_3_b), (numbers_4_b), (numbers_5_b)}

numbers_wrong_b = lottery_numbers.difference(numbers_b)
numbers_right_b = numbers_a.intersection(lottery_numbers)

print(" ")

print("The lottery numbers was " + str(numbers_wrong_b) + ".")
print("You got " + str(len(numbers_right_b)) + " right.")


Player_1 = [
{'name_of_player_one':str(PLAYER_NAME_1), 'player_ones_numbers':str(numbers_a)}
]

Player_2 = [
{'name_of_player_two': str(PLAYER_NAME_2), 'player_twos_numbers':str(numbers_b)}
]

print(" ")

print("Thank you for playing!")

print("Stats:")

print(Player_1)

print(" ")

print(Player_2)
?