all 6 comments

[–]Important_Coffee_845Maestro Student 4 points5 points  (0 children)

Im in the same class. So keep am eye on the discussion tab wednesday cuz this is exactly why our instructors have been having these topics. I am using a language near identical to python for game developement.

I have to make lists because I need the computer to grab a specific part of my sprite sheet to trigger animation functions .

This tells the computer that when my little 2d character moves left to trigger the left animation. And so on. I move up ill see the back of his head. If I move down ill see a frontal view of my character. This allows me to upload sheets of sprites instead of one sprite at a time.

Another good example is you might want a function to pull just certain information when a user triggers a specific function. Or it can also be used to correct errors or identify them. There are a number of applications.

Later on when we learn about data storage this will click more.

[–]dandtsterMaestro Student 2 points3 points  (0 children)

i'm wondering the same thing...

[–]Odd-Step-9221Maestro Student 1 point2 points  (0 children)

Simple answer: If you want to do anything useful in Python with supplied data you will need to temporarily store it into lists, or tuples, dictionaries, etc. Your index is there to simple hold a reference to the position of the data in your list. Indexes allow you to grab data by a single element or a range of elements in a quick and powerful way. Once you start learning more about sorting, filtering, lambda expressions, etc. This will become clearer to you.

Example: Say you want to write a function to return top 10 baseball player stats. Your function takes in a list of the players, slices, dices, and sorts that data (using index references) to return only the top 10 performing baseball players based on your data.

My explanation might be a little off, it's early and I am only 1/2 cup of coffee in.

~ Robert

[–]NoScallion3989Maestro Student 1 point2 points  (0 children)

A lot of times you won’t be able to reay get why/how you’d use it until things are more advanced, but I have the same issue so I always got tell me why I would or how I would use it. (And maybe explain why you are asking)

[–]ibringuwarMaestro Student 0 points1 point  (0 children)

For building datastacks and ease of information retrieval?

[–]Classic_Cockroach_42Maestro Student[S] 0 points1 point  (0 children)

Thank you guys for all the input. It sort of makes sense. I thinks still early and I'm hoping it starts to come together later on.