Python for Beginners: 21. Comprehensions in Python (List, Set & Dictionary)
Learn to make your code more readable, elegant and shorter using list comprehensions. We will also take a look at set and dictionary comprehension with some examples. Please don't forget to like, share and subscribe !!! Link(s): Code (in Google Colab), includes bonus script for 3-D array: https://colab.research.google.com/drive/1QYZHeGd0bBP76uWQB5co_j7G8ML8Grh5?usp=sharing Code in GitHub: https://github.com/ComputingUntangled/Python-for-Beginners/blob/main/Comprehensions%20in%20Python%20(List%2C%20Set%20and%20Dictionary).ipynb Tutorial for List Manipulation: https://www.youtube.com/watch?v=q9fTAr6xnmQ Data Types, Variables, Mutability, and Their Use Cases: https://www.youtube.com/watch?v=b0XQAeQi_C0 Time-Stamps: 00:00 Opening remarks 00:24 Understanding basic concepts 01:52 List Comprehension using a range() function as iterable 03:04 List Comprehension Involving a Nested for-Loop 04:32 List Comprehension using existing list as iterable 05:14 List Comprehension involving an if-statement 06:13 List Comprehension involving nested if-statements 07:10 List Comprehension Involving if-else statement (using tuple as iterable) 08:09 List Comprehension to create a 2-DMatrix 9:10 List Comprehension to create a 3-D Matrix 10:49 List Comprehension Involving functions 12:23 Set comprehensions 13:38 Dictionary comprehensions 14:43 Closing remarks
Download
0 formatsNo download links available.