filmov
tv
Python Dictionary Iterate | How to Use For Loops With Dictionaries?

Показать описание
In this video, we will focus on Python Dictionary Iterate . We will learn how to use iteration with python dictionaries. In other words, we will learn for loop usage with python dictionaries.
******************************************************************************
Example 1:
character ={
"race": "wizard",
"name": "Gandalf",
"color": "grey",
}
for x in character:
print(x)
Output:
race
name
color
******************************************************************************
Example 2:
device ={
"vendor": "Cisco",
"model": "9000 series",
"RU": 44
}
for x in device:
print(device[x])
Output:
Cisco
9000 series
44
******************************************************************************
Example 3:
device ={
"vendor": "Cisco",
"model": "9000 series",
"RU": 44
}
print(x)
Output:
('vendor', 'Cisco')
('model', '9000 series')
('RU', 44)
*****************************************************************************
.
.
Social Media:
**********************************************************
**********************************************************
.
#pythondictionaries pythondictionary #pythondictionaryforloop #pythonprogramming #python3 #python #pythoncourse #freepythoncourse
******************************************************************************
Example 1:
character ={
"race": "wizard",
"name": "Gandalf",
"color": "grey",
}
for x in character:
print(x)
Output:
race
name
color
******************************************************************************
Example 2:
device ={
"vendor": "Cisco",
"model": "9000 series",
"RU": 44
}
for x in device:
print(device[x])
Output:
Cisco
9000 series
44
******************************************************************************
Example 3:
device ={
"vendor": "Cisco",
"model": "9000 series",
"RU": 44
}
print(x)
Output:
('vendor', 'Cisco')
('model', '9000 series')
('RU', 44)
*****************************************************************************
.
.
Social Media:
**********************************************************
**********************************************************
.
#pythondictionaries pythondictionary #pythondictionaryforloop #pythonprogramming #python3 #python #pythoncourse #freepythoncourse