For this project, i need to know the name of the first key in the dictionary without knowing the actual name of the key. This is what I have so far:
import random
maxed_brawlers = {}
non_maxed_brawlers = {"Shelly" : 0}
coins = 0
gems = 0
max_powerpoints = 1410
powerpoint_levels = {"Level two" : 20, "Level three" : 30, "Level four" : 50, "Level five" :
80, "Level six" : 130, "Level seven" : 210, "Level eight" : 340, "Level nine" : 550}
coin_levels = {"Level two" : 20, "Level three" : 35, "Level four" : 75, "Level five" : 140,
"Level six" : 290, "Level seven" : 480, "Level eight" : 800, "Level nine" : 1250}
chat = input("Message... ")
while chat != "":
for ele in non_maxed_brawlers:
if non_maxed_brawlers[ele] == max_powerpoints:
maxed_brawlers.append(ele)
non_maxed_brawlers.pop(ele)
if chat == "!box":
if len(non_maxed_brawlers) == 1:
random.shuffle(non_maxed_brawlers)
amount = random.randint(10,15)
for key in non_maxed_brawlers[0]:
print(str(key) + str(amount))
I'm trying to print out the randomly generated number next to which key is getting it, but I won't be able to know the name of the key. I would only be needing the first and second one, so I would be able to use the index [0, 1]. Thank you in advance