본문 바로가기

Python24

7. Python collection type - Dictionary 1. Dictionary The dictionary is a mutable collection composed of key-value pairs. Key is a unique identifier, and Value is data associated with the key. 1-1. Creation Dictionaries are created using curly braces {}, and key-value pairs are separated by commas ,. Each key-value pair is separated by a colon :. 1-2. Mutability Dictionaries are mutable. That is, the user can add, remove or change exi.. 2024. 3. 14.
6. Python collection type - Set 1. Set A set is a Python data structure that stores a collection of unique and unordered values. 1-1. Creation Sets can be created directly by using curly braces {} and listing the elements separated by commas. 1-2. Methods Set has several methods. 2024. 3. 14.
5. Python collection type - Tuple 1. Tuple A tuple is an immutable collection with ordered elements that can store values of various data types. Immutable: After creating tuples, elements cannot be added, deleted, or modified. Efficient: Tuples are more memory-efficient than lists, particularly aiding in performance enhancement when data is infrequently modified. 1-1. Creation Tuple is created using parentheses (), and each item.. 2024. 3. 14.
4. Python collection type - List 1. Collection Types? It refers to a data structure that allows multiple data items to be managed as a unit. It allows multiple data items to be stored and managed in one variable. In Python, lists, tuples, sets, dictionaries, and more belong to the basic collection types. 2. List A list is a sequential data structure that allows user to store and manage multiple values in one variable. 2-1. Crea.. 2024. 3. 14.