A FASTER Way To Create Dictionaries In Python #code #python #programming

preview_player
Показать описание
Here's a faster way to create dictionaries in Python #code #python #programming

▶ Become job-ready with Python:

▶ Follow me on Instagram:
Рекомендации по теме
Комментарии
Автор

IMO, dictionary comprehension is just as easy or easier: {key: 0 for key in my_iterable}. It also allows computed values rather than a single default value.

davidpement
Автор

Bro need to get better at naming variables😭

k_gold
Автор

Name your variables and methods something else _please_ 😭😭😭

somerandomdude
Автор

Should've named the variable my_dic... That's more comprehensive imo!

quantumlegend
Автор

could also use zip(iterable_a, iterable_b) to put a different value for each key.

davidyoung
Автор

And how can you add each value?

It's only possible editing the dict after the variable assignation?

nopinias
Автор

How do fill them with dynamic values? Each having their own values.

thedelanyo
Автор

Does _value: (iterable) work so they would have their own value?

Zielendief
Автор

ima impress my it teacher when i go to school

INSIDE_JOKE
Автор

Bro have to check twice his variable names.

SANJAY-veub
Автор

Sometimes he is naming his methods like meth1, meth2 and now its variables like my_d.

undercover
Автор

Im guessing this is faster than a dict comprehension?

sobbski
Автор

why we can't use list or dictionary in dictionary key

yasink
Автор

Bro the fastest way to create a dictionary just use dict keyword

P.Shivakrishna
Автор

__value:0 is invalid syntax when I tried it.

Cloudxxx
Автор

The issue about inserting my_d is that it does not allow me to figure out what's going on. Blood on the wrong place and all

trigdentity