Dictionary Comprehension - Create Complex Data Structures Step by Step
Python Simplified
@pythonsimplifiedAbout
Hi everyone! My name is Mariya and I'm a software developer from Sofia, Bulgaria. I film programming tutorials about Computer Science Concepts, GUI Applications, Machine Learning and Artificial Intelligence, Automation and Web Scraping, Data Science and even Math! π€ I'm here to help you with your programming journey (in particular - your Python programming journey π) and show you how many beautiful and powerful things we can do with code! πͺπͺπͺ
Video Description
Welcome to the best tutorial I've ever filmed!!! πππ Today we will talk about Dictionary Comprehension which is a very clever technique to construct dictionaries from different collections of data. We will start with a π basic code example π (00:47 - 03:47) and we will move on to practice our new set of skills with 3 FUN and USEFUL exercises: 1. Superheroes exercise: correct a distorted dictionary (03:47) 2. Genetics exercise: create a random DNA sequence by pairing bases (08:26) 3. Authentication exercise: create a dictionary of users with random passwords (14:55) β Get complete tutorial code β https://app.wayscript.com/lairs/6d18a957-46bd-4283-8b97-c323c9b0245d/public/ π₯ RELATED TUTORIALS π₯ --------------------------------------------- β Python For Loops for Beginners: https://youtu.be/dHANJ4l6fwA β List Comprehension: https://youtu.be/SNq4C988FjU β° Time Stamps β° -------------------------------- 00:00 - intro 00:21 - tutorial plan 00:47 - create dictionary with for loops 01:04 - zip function approach 01:37 - range function approach 02:05 - dictionary comprehension with zip 02:47 - dictionary comprehension with range 03:17 - dictionary comprehension with tuples 03:27 - dictionary comprehension with Pandas Data Frames 03:47 - modify dictionary in place (exercise #1 - superheroes) 08:26 - create a dictionary of lists (exercise #2 - DNA) 14:55 - create a list of dictionaries (exercise #3 - user authentication) 17:23 - create random passwords 20:46 - dictionary and list comprehension disadvantages 21:12 - outro and thanks for watching! :) π» Copy starter code π» ---------------------------------------- β EXERCISE 1: my_dict = { "Spider": "photographer", "Bat": "philanthropist", "Wonder Wo": "nurse" } β EXERCISE 3: keys = ["id", "username", "password"] users = ["mariyasha888", "KnotAbot", "spongiBOBO", "IAMBATMAN"] π€ Connect with me π€ -------------------------------------- π Github: https://github.com/mariyasha π Discord: https://discord.com/invite/wgTTmsWmXA π LinkedIn: https://ca.linkedin.com/in/mariyasha888 π Twitter: https://twitter.com/mariyasha888 π Blog: https://www.pythonsimplified.org π³ Credits π³ ---------------------- β Beautiful icons by: flaticon.com β Beautiful animated graphics by: mixkit.co
Kitchen Must-Haves for Quick Bread
AI-recommended products based on this video

NIV, Artisan Collection Bible, Womenβs Bible with Journaling Space, Cloth over Board, Pink Floral, Designed Edges under Gilding, Red Letter, Comfort Print

Natural Vine Dark Spot Corrector: Dark Spot Remover for Face Body in 4-8 Weeks - Instant Concealing & Age Brown Sun Faded Spot Remover Melasma Freckles Correcting with Niacinamide for Women & Men 60g

3D Spiral Apples Silicone Molds for Baking | Food Grade Mousse Cake Chocolate Molds | Reusable Baking Molds Silicone Shapes (3.46x3.46x2.09in)

Apples Silicone molds Spiral Pastry Chocolate Mousse Cake Molds for Cupcake topper, Candy, Gummy, Ice Cube, Soap

Spiral Apples Mousse Cake Silicone molds French Pastry Chocolate molds Candle molds Burns Up to 45 Hours - Pack of 6, Frost




















