Do people actually use lists in Python for programming or is it all done in databases like mysql now?

I’m making my way through the basic Python 3 tutorial and lists feels very familiar to me and fun. But I’m wondering: do programmers still rely on things like lists or is it all done via databases now? If lists are still in play, any examples of where they still flourish?

thanks!

Data structures (like list) and algorithms are still the fundamentals of programming, that hasn’t changed. Data structure (including lists) are everywhere.

Lets say you retrieve 10 records from the database, you have a list of database records/rows.

4 Likes

Databases are just for storing data. You’re right that data is usually stored in a database. This is because things like Python lists get wiped from memory when the program ends. However, when you retrieve data from a database, you have to save it into a Python data structure before you can use the data in Python. So you will be using the list the entire time you are working with the data. Then you can save it back to the database when you are done.

So databases and lists are used all the time and at the same time.

2 Likes

Thank you this is very helpful.

1 Like