2024_GR5245 class1 Python review
2024_GR5245 class1 Python review
Python Review
Built-in data types
• Basic data types: int, float, string, bool, complex
• Dynamically typed
• Operators
Built-in data structures
• List: mutable
• Tuple: immutable
• Dictionary: key-value pairs
Slice operator
Iterations
• Iteration • Iterable:
• an object that returns its members one at a time
• used in a for statement
• examples: range, list, tuple, strings, dictionary
• Syntax
List comprehension
• Convenient and compact ways of defining new lists
Defining functions
• Multiple outputs
• Vectorization • Broadcasting
Google Colab