Buradasın
Python Data Structures Overview
docs.python.org/3/tutorial/datastructures.htmlYapay zekadan makale özeti
- Lists
- Lists can be used as stacks (last-in, first-out) with append and pop methods
- Lists can be used as queues (first-in, first-out) but are less efficient
- List comprehensions provide concise way to create lists from other sequences
- Del statement removes items by index instead of value
- Tuples and Sequences
- Tuples are immutable sequences of values separated by commas
- Tuples can contain mutable objects like lists
- Sequences are accessed via indexing or unpacking operations
- Empty tuples are created with empty parentheses
- Sets and Dictionaries
- Sets are unordered collections with no duplicate elements
- Dictionaries are key-value pairs with unique keys
- Dictionaries support mathematical operations like union and intersection
- Keys can be strings, numbers, or tuples
- Looping and Comparison
- Items() method retrieves key and value in dictionaries
- Enumerate() function returns index and value in sequences
- Comparison operators can be chained and combined using and, or, not
- Sequences compare lexicographically, strings use Unicode code points