+ 2

When to use lists

When can we use "lists" in a python program

29th Oct 2019, 6:57 AM
Beautiful Mind
Beautiful Mind - avatar
8 Réponses
+ 6
hi, i have put some facts together for you: https://code.sololearn.com/cyumYp6R47lS/?ref=app
29th Oct 2019, 9:49 AM
Lothar
Lothar - avatar
+ 9
You can use lists whenever you need to keep several things somewhere. Maybe you want to sort them, of shuffle them up, or reverse the order. With lists you can do all of that. I've written a typing trainer that modifies a list of words the way you say (for example all words with q in it or whatever) and feeds them to you. I've written a calory calculator that stores several food items with their calories and other values in a list. You can add more foods or delete them. I've written a learning aid, that works over a list with 'study cards' that have a question and an answer and some other info. The list gets shuffled up and presented for you to learn. There are uncountable use cases really, and while learning more, you'll probably come up with some of your own.
29th Oct 2019, 12:40 PM
HonFu
HonFu - avatar
+ 5
Another example of the usefulness of lists is to retain a series of results which may occur throughout a code, then being able to retrieve a specific result from the list to use again.
29th Oct 2019, 9:56 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 4
Hello my friend, well this is a data structure very usefull, and you can use this specially when you want yo store several values for any purpose, but you have to be careful with the quantity of values because lists are all little bit slower, if you want to store many many data, you probably should use the numpy lists
29th Oct 2019, 11:57 PM
Esteban Alexis Arce Gómez
Esteban Alexis Arce Gómez - avatar
+ 2
I can't tell you the utility : discover it by yourself while practicing. Then you will understand how useful are lists.
29th Oct 2019, 7:44 AM
Théophile
Théophile - avatar
+ 2
Thanks
29th Oct 2019, 9:53 AM
Beautiful Mind
Beautiful Mind - avatar
+ 2
List is a collection which is ordered and changeable and indexed. Allows duplicate members.
30th Oct 2019, 11:45 AM
Souvick Mondal
Souvick Mondal - avatar
+ 1
Generally lists are used on roster pages, such as greatest to least. Or perhaps if you want to get fancy, your grocery list. There are many places lists are used, but the intention is purely situational.
31st Oct 2019, 2:22 AM
Dylan Bacon
Dylan Bacon - avatar