Thread by Aishwarya Nevrekar
- Tweet
- Mar 1, 2023
- #ComputerProgramming
Thread
Advanced Python Concepts
A thread🧵👇
A thread🧵👇
1. Lambda Functions
Lambda functions are particularly useful in cases where we need to have a short one-time use function.
Syntax: lambda arguments: expression
Lambda functions are particularly useful in cases where we need to have a short one-time use function.
Syntax: lambda arguments: expression
2. Exceptional Handling
An exception is a condition that occurs during the execution of the program and interrupts the execution.
We use to try and except blocks to handle exceptions in python. To handle multiple exceptions at a time we use multiple except blocks.
An exception is a condition that occurs during the execution of the program and interrupts the execution.
We use to try and except blocks to handle exceptions in python. To handle multiple exceptions at a time we use multiple except blocks.
3. Decorators
Decorators are higher-order functions that modify other functions' behavior without affecting their core functionalities. Unlike other objects, they can be defined inside a function, passed as an argument in other functions, and even return as a function.
Decorators are higher-order functions that modify other functions' behavior without affecting their core functionalities. Unlike other objects, they can be defined inside a function, passed as an argument in other functions, and even return as a function.
4. Comprehensions
This technique allows us to create a list, dictionary, or set using an existing iterable, which is named list comprehension, dictionary comprehension, and set comprehension, respectively.
Below is an example of list comprehension
This technique allows us to create a list, dictionary, or set using an existing iterable, which is named list comprehension, dictionary comprehension, and set comprehension, respectively.
Below is an example of list comprehension
5. Generators
Generators are lazily-evaluated iterators that render items only when requested, and thus they’re very memory efficient. They should be used when you’re dealing with a large amount of data sequentially.
Generators are lazily-evaluated iterators that render items only when requested, and thus they’re very memory efficient. They should be used when you’re dealing with a large amount of data sequentially.
Mentions
See All
Afiz ⚡️ @itsafiz
·
Mar 1, 2023
Great thread!
Akshay 🚀 @akshay_pachaar
·
Mar 1, 2023
Great Thread! 👏