How to use Dictionaries in Python - #First steps in Python part 10

Subscribers:
2,490
Published on ● Video Link: https://www.youtube.com/watch?v=OrE3nVlIeac



Category:
Guide
Duration: 10:40
12 views
1


Today, I learned a bit more about Python, and I discovered what Dictionaries really are, and how they help a system store AND find information.
basically, with a dictionary I can assign lot's of information into a simple, short name I can easily get.

for exemple:

hamburgers = {"cheeseburger" : ["bread, cheese, ham meat", price, instock],
"x-bacon" : ["bread, bacon, ham meat", price, instock]}

in that little code, I have set up a dictionary (hamburgers) and I have inside two items: cheeseburger and x-bacon, and inside those I have their ingredients, price and how many are in stock (the last 2 being a variable that can change).

If I am running the code and I want to get the information on one of my items, I can just do a

burger = input("What do you want to search")
print(hamburgers.get(burger)

and than it just prints the values of the specific burger I want to find information about.
the reason this is important is that I can compact a lot of info by using a dictionary for a enormous amount of things (like a dictionary customers) and then inside the dictionary I have the individual customers and then inside that their info, so yeah, extremely useful and can make code much easier.

If you want to help me change the world: https://apoia.se/teteusbionic

If you have any question or suggestion on other topics, feel free to comment down below or ask me in Facebook or Instagram!

Visit my Facebook Page in: http://fb.com/teteusbionicoficial
Visit my Instagram: https://www.instagram.com/teteusbionic/
Visit my Website: http://www.teteusbionic.com.br




Other Videos By Teteus Bionic (Teteus Bionic)


2021-06-16Como Ler Variables em Python - #AprendendoPython 15
2021-06-11Como armazenar informações em Python - #AprendendoPython 14
2021-06-11How to Store Information in Python - #LearningPython 14
2021-06-10How to use Files in Python - #FirststepsinPython part 13
2021-06-10Como usar Arquivos em Python - #PrimeirospassoscomPythonparte 13
2021-06-08Como adicionar info em Dicionários em Python - #Primeiros passos com Python parte 12
2021-06-08How to add info to Dictionaries in Python - #First steps in Python part 12
2021-06-03How to use Dictionaries to Store Information in Python - #First steps in Python part 11
2021-06-03Como usar Dicionários para Armazenar Informação em Python - #Primeiros passos com Python parte 11
2021-05-27Como usar Dicionários em Python - #Primeiros passos com Python parte 10
2021-05-27How to use Dictionaries in Python - #First steps in Python part 10
2021-05-26The Difference between Lists and Definitions - #First steps in Python part 9
2021-05-26A Diferença entre Listas e Definições - #Primeiros passos com Python parte 9
2021-05-21How to Define and Modulated a Code in Python - #First steps in Python part 8
2021-05-21Como Definir e Modular Código em Python - #Primeiros passos com Python parte 8
2021-05-20Como Procurar e Modificar Listas em Python - #Primeiros passos com Python parte 7
2021-05-20How to Search and Modify Lists in Python - #First steps in Python part 7
2021-05-18Como ler LISTS com Python - #Primeiros passos com Python - 6
2021-05-18How to use and read LISTS in Python - #First steps in Python 6
2021-05-17Como usar LISTAS com Python - #Primeiros passos com Python parte - 5
2021-05-17How to use Lists in Python - #First steps in Python 5



Tags:
Programação de Jogos
Curso de Programação de Jogos
Palestra Programação de Jogos
Oficina Programação de Jogos
Scratch
Fazer Jogo
Criar um Jogo
Como fazer um jogo
Fazer um jogo sozinho