I am making a dictionary and I set up a variable string thing inside the dictionary and it's "numbers" and when I tried to pull the information it gave me a NameError saying it wasn't defined and I'm too stupid to figure it out.
x = {"player_1":"Player 1", "numbers":{2,5,4,43,12,24}}
x_1 = {"player_2":"Player 2", "numbers":{12,14,23,35,15,6}}
x_2 = {"player_3":"Player 3", "numbers":{32,2,65,35,32}}
x_3= {"player_4":"Player 4", "numbers":{24,23,26,58,27}}
for playername in x:
inter_var = len(this_dict[numbers].intersection(playername))
top_player = playername
if inter_var > len(top_player[numbers].intersection(lottery_numbers)):
print(f"{top_player} won {winnings}")
Not sure what your goal is, but you should start with something like the following, with consistent keys and a goal like counting matching numbers:
Output: