0

I need help assigning multiple values to keys. I know there is other questions like this one, however I don't really get their examples.

Here's my code, I want to add a damage value to the sword keys.

normalswords={
"TRAINING SWORD":"A sword meant for training, no element, 10 damage"}

Please help!

ypranite
  • 103
  • 1
  • 1
  • 8
  • Assign a key to a list as the value? – Andrew Li Jul 11 '17 at 00:11
  • What do you not understand about the other questions and their examples? – victor Jul 11 '17 at 00:14
  • @TheGamerCow, As suggested, why don't you make a list of the values you want to include for the key? `normalswords={"TRAINING SWORD":["A sword meant for training", "no element", "10 damage"]}`, then `normalswords['TRAINING SWORD'][2]` returns `'10 damage'`. Is that what you are asking for? – chickity china chinese chicken Jul 11 '17 at 01:22
  • Yeah actually except I want the "10 damage" to be an integer. Thank you – ypranite Jul 11 '17 at 01:32
  • Sure, glad to try to help. So try `normalswords={"TRAINING SWORD":["A sword meant for training", "no element", 10]}`, then `normalswords['TRAINING SWORD'][2]` will return `10`. You can confirm it's an integer like this: `type(normalswords['TRAINING SWORD'][2])` returns -> `` – chickity china chinese chicken Jul 11 '17 at 16:25

0 Answers0