+ 3
Where and why can we use lists
Where and why can we use lists
6 ответов
- 1
ThankYou so much David for the web site
+ 3
Lists are awesome. We use them all over. Check my codes and see where I have used them.
I made a snake game and used a list to keep track of my snake parts.
in my hangman game, I used a list to hold words to use. I had another list to keep track of Letters attempted. Not to mention the list to hold the "graphics"
In my Blackjack and Dice games, I use lists to hold the images or the cards and dice values.
https://code.sololearn.com/cooDpbbEc1VK/?ref=app
+ 3
That's ok. Learn how they work. When you have a need for a list, you will know..
It is one of the hardest parts I had beginning too. Knowing why/when/where to apply the stuff I'm learning is a bit confusing.
Lists are just a convenient way to store things. Say you need to randomly choose an action for a character... You can make a list of actions you want to choose from.
verbs=["Jump", "Run", "Duck"]
Then you can select one of the as actions from the list anytime you needed a random action performed.
Or of course you could pick one specifically.. for instance verbs[1] is Run
+ 3
thank's a lot i totally understande THANK'S BRUH
0
thank u but i still don't underestand them :/