I'm only starting to understand classes, and when I searched it up, and found out how strings and dictionaries are what they are because they are defined, built in classes (did I understand correctly?), and it clicked for me, but I'm not sure if it's an accurate/correct click. So is it like this, or in the area:
the built in, say, list class gives the list all its attributes, how each value is related to an index, and how new parts of the list can be appended by using the .append() method, and etc.? If this is the case, does anyone know where to find the code of 'list class'? Because I want to truly understand the special attributes and significance of a class, as opposed to a function.
Because, to my understanding, the difference between a class and a function's uses are nonexistent. In other words, there is a built in list class, but couldn't it be just a built in list function? Also, a class can contain lists, dictionaries, and functions, and is just a way of storing data under objects, and producing objects with similar properties. Well, can't a function do the exact same thing? A function can store functions, dictionaries, lists, etc. Functions also produce outputs/objects with similar attributes. And when a class is called on an input, it just looks exactly like calling on a function. I don't see any difference, only the syntax. Otherwise, to me it seems like a class has the same role as function.
In sum, what is the difference between a class and a function? Sunflowers are plants, whereas dogs are animals. Strings contain text, whereas int and float data types store numbers. Now, what does a class have that a function can't do?
Please clarify my confusion. Thank you so much