PYTHON DICTIONARIES & FOR LOOPS (Beginner's Guide to Python Lesson 8)

preview_player
Показать описание

---

Welcome to the Beginner's Guide to Python! This is video #8 in the series. In this video, I'm going to teach you how to use dictionaries and for loops in Python.

COURSES I TEACH

OTHER VIDEOS YOU MIGHT LIKE
Рекомендации по теме
Комментарии
Автор

# This is the dictionry
pips = {"Tie":1, "Noah":2, "Ma":3, "rye":4, "Law":5, "shoe":6, "Cow":7, "ivy":8, "Bee":9, "Toe":10}
# Request the user pick a number to the associated Key
Peg = input(“ pick a number from 1-10 ” + pips [ ])
Print(“This is your associated key ” + peg)
#How do you get the associated user input to the dictionry?

thairston
Автор

Underrated viedo...video... think if you went through more ways to do it and larger dicts it would be even better. You do have the best one I've seen out of the many. Regular editor and real loops. Good job. Update it. I would definitely watch.

registeredrepublican
Автор

Sir plz increase your font size for more convenience 😁😎

harshsahu
Автор

Epic! Thank you man this helped me a lot, keep up the good work!

ragnarhelgi
Автор

Awesome! Thank you from Texas!

Stay safe during the Coronavirus.

swallowedinthesea
Автор

thx for video im learning python at school :)

matthieu_fulhaber
Автор

5 years later - still helpfull <333

sickie
Автор

Sir it would be great if u could've explained us how to use for loops in dictionaries with if-elif-else statement.

Farhan-mves
Автор

Hey, this video is awesome, and you're a great teacher. Thank you.

PatentPending
Автор

But yes, what if i wanted to create a dictionary based on previously made list and use the values from that as keys.. how do i get them into the dictionary then??

miriam
Автор

I am trying to update a nested dictionary within for loop. The issue I am facing is the dictionary within dictionary values are a list and I need to update say 100th index of the list with a numpy array element. It updates inside the loop using either exec command or using key value pair in for loop. But outside for loop I see that all the elements are updated with the last numpy element, It looks the for loop is overwriting the list for each dictioanry. Any solution?

du
Автор

where does the stock_count come in on the 2nd for loop? This is where I am not that great at traversing yet.

TheCbrown
Автор

Can you help me understand how "stock_count" worked in your code. you did not define that as a variable before so i couldn't follow how you used it in the second 'for' loop.

for apple, stock_count in apples.items():

udaypamphilos
Автор

If I had data from an excel sheet I believe I can use openxpy to grab the data and make python work with it. From there how could I make it so that instead of filtering for lets say the number of gala, fiji, pink lady, etc apples--- how could i make it so that python can draw the numbers for them automatically?

hseas
Автор

Hello im hoping you can help me. I have 2 dictionaries that i need to get the total_value of.
I need to get "the total_value is 280.36" displayed in the console.

stock = {
"Apples": 15,
"Banana": 20,
"Cherries": 19,
"Strawberries": 10,
}
print(stock)


price = {
"Apples": 4.99,
"Banana": 2.99,
"Cherries": 3.99,
"Strawberries": 6.99,
}
print(price)

hennieliebenberg
Автор

Hello, can you help me with this dict?
asort= [
{'name': 'apple', 'price': 2.49},
{'name': 'orange', 'price': 23.90},
{'name': 'banana', 'price': 3.49},
]

How to create the function that search the fruit and return the price. For example: client write input "apple" and function returns "2.49".

Автор

sir please tell me how to use dictionary for make english dictionary if user enter some word it can show the meaning

hasibkhan
Автор

We've just launched: *Python for Beginners: Learn how to code properly in 2021*

LondonAppDeveloper
Автор

I wouldn't recomend this song. All thumbs down.!.!.!

jessieorozco