RUVIDEO
Поделитесь видео 🙏

Lesson - 21 : Python3 - Python Variables : Dictionary

**************************************************
Python Core PlayList : https://www.youtube.com/watch?v=_laUbUtzMOs&list=PLxWzQv_1I_ACFomYYjF0HMqmu-w2pyqta
Python Advanced PlayList : https://www.youtube.com/watch?v=RSKv-gSKrpA&list=PLxWzQv_1I_ACjp_DGDwHlTZlndqi4cu0_
**************************************************
Python DataType : Dictionary:

Dictionaries in Python are lists of Key:Value pairs. This is a very powerful datatype to hold a lot of related information that can be associated through keys. The main operation of a dictionary is to extract a value based on the key name. Unlike lists, where index numbers are used, dictionaries allow the use of a key to access its members. Dictionaries can also be used to sort, iterate and compare data.

Dictionaries are created by using braces ({}) with pairs separated by a comma (,) and the key values associated with a colon(:). In Dictionaries the Key must be unique. Here is a quick example on how dictionaries might be used:

room_num = {'john': 425, 'tom': 212}
room_num['john'] = 645 # set the value associated with the 'john' key to 645
print (room_num['tom']) # print the value of the 'tom' key.
room_num['isaac'] = 345 # Add a new key 'isaac' with the associated value
print (room_num.keys()) # print out a list of keys in the dictionary
print ('isaac' in room_num) # test to see if 'issac' is in the dictionary. This returns true.

Built-in Dictionary Functions :
1. cmp(dict1, dict2) : Compares elements of both dict.
2. len(dict) : Gives the total length of the dictionary. This would be 3. equal to the number of items in the dictionary.
4. str(dict) : Produces a printable string representation of a dictionary
5. type(variable) : Returns the type of the passed variable. If passed variable is dictionary, then it would return a dictionary type.

Built-in Dictionary Methods:
1. dict.clear() : Removes all elements of dictionary dict
2. dict.copy() : Returns a shallow copy of dictionary dict
3. dict.fromkeys() : Create a new dictionary with keys from seq and values set to value.
4. dict.get(key, default=None) : For key key, returns value or default if key not in dictionary
5. dict.has_key(key) : Returns true if key in dictionary dict, false otherwise
6. dict.items() : Returns a list of dict's (key, value) tuple pairs
7. dict.keys() : Returns list of dictionary dict's keys
8. dict.setdefault(key, default=None) : Similar to get(), but will set dict[key]=default if key is not already in dict
9. dict.update(dict2) : Adds dictionary dict2's key-values pairs to dict
10. dict.values() : Returns list of dictionary dict's values

Sample Projects : https://github.com/SadaLearningHub1/Python3-Core-And-Advanced-Examples

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Lesson - 21 : Python3 - Python Variables : Dictionary», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.