Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Python Arrays?

I need to set the elements of the abilities array equal to the score array. So that they can see the score of each ability.

For example: You roll a 15 and want to set it to strength. How do I show that strength now has a score of 15?

Attachment image

1 Answer

Relevance
  • EddieJ
    Lv 7
    1 month ago

    Hi, Michael,

    Well, I'm not sure I completely understand what you are trying to do, but I think I would do it very differently.  However, I'm not sure if your assignment requires you to do it a certain way.Instead of the <if> statements, you could use the .find () method to determine the index of the ability in abilities.And then you should be able to use that index to set or add to that position in scores without pop () and insert ().You should probably also use a <for> loop instead of the <while> loop, since you know the number of times you want it to loop.Also, you need to learn to think like a programmer.  In other words, you should realize that WE would like to try to run your code, so we would like the text rather than just a picture of it.  It's OK to ALSO post a picture.

Still have questions? Get your answers by asking now.