Python Tutorial 30: Dictionaries And While Loops

  Рет қаралды 4,149

Hank The Tank

Hank The Tank

3 жыл бұрын

Hey what's going on guys welcome back to the another python tutorial . Yea , so in this video we will see how to use while loops to insert new keys and values into a dictionary. It is exactly same as we did for the for loop .
Link To My Python Tutorial Playlist :
• Python Tutorial 1: Int...
Link To My Front-End Projects Playlist :
• Just using HTML and CS...
I upload programming videos regularly , so if you guys are interested in learning programming you can subscribe and turn the notification bell on , for more such videos.
I recently started front end development , you can check out my front end playlist for more front end tutorials in html , css and javascript.
If you are new to the channel and if you haven't subscribed yet , please go ahead and subscribe .
If you have anything to say about my codes or if you have any doubts regarding what i explain , you can always comment down below about your issue and i will make sure to answer your questions.
Thanks for watching , stay home , stay blessed.
#python #pythonprogramming

Пікірлер: 11
@stephen285
@stephen285 Жыл бұрын
thanks for your video!, I was able to use it to understand how to make a self building dictionary, much appreciated dictionary = {} # dictionary is a container data type for key: value i=0 while i < 10: p = str(i) key = str("Item " + p) # this is the key string value = i + 1000 # this is the value integer dictionary[key] = value #this is the line that populates the dictionary each time thru the loop i = i + 1 #this iterates thru the loop until 10 is reached print(dictionary) print(dictionary.get("Item 4"))
@HankTheTankCoding
@HankTheTankCoding Жыл бұрын
I'm glad you enjoyed it ❤️
@aroojfatima9335
@aroojfatima9335 2 жыл бұрын
Thankyou for this, how do you search for an item in a dictionary using either key or value?
@HankTheTankCoding
@HankTheTankCoding 2 жыл бұрын
Using "key"
@oguzturkyilmaz543
@oguzturkyilmaz543 2 жыл бұрын
Thank you very much
@sanjroks
@sanjroks 3 жыл бұрын
Nice one! What if we want to store name and marks both for a particular roll number?
@HankTheTankCoding
@HankTheTankCoding 3 жыл бұрын
One key can only hold one value, so im afraid we can't, we will need to add something else to differentiate between two keys
@sanjroks
@sanjroks 3 жыл бұрын
@@HankTheTankCoding if we try to insert another dictionary inside the roll key as values?
@HankTheTankCoding
@HankTheTankCoding 3 жыл бұрын
@@sanjroks yep you can do that, you can have nested dictionaries no prob with that 😉
@sanjroks
@sanjroks 3 жыл бұрын
@@HankTheTankCoding Alright I am lazy to do that by myself 😄
@HankTheTankCoding
@HankTheTankCoding 3 жыл бұрын
Haha!
Python Tutorial 31: Nested While Loops
5:23
Hank The Tank
Рет қаралды 4,1 М.
ДЕНЬ РОЖДЕНИЯ БАБУШКИ #shorts
00:19
Паша Осадчий
Рет қаралды 3,9 МЛН
小路飞姐姐居然让路飞小路飞都消失了#海贼王  #路飞
00:47
路飞与唐舞桐
Рет қаралды 94 МЛН
Тяжелые будни жены
00:46
К-Media
Рет қаралды 5 МЛН
Chips evolution !! 😔😔
00:23
Tibo InShape
Рет қаралды 42 МЛН
Dictionary in Python
12:24
Telusko
Рет қаралды 1,3 МЛН
Python - Accessing Nested Dictionary Keys
24:48
Academind
Рет қаралды 179 М.
I visited the world's hardest math class
12:50
Gohar Khan
Рет қаралды 130 М.
Python Tutorial: Extracting values from dictionaries with for loops
8:02
While loops in Python are easy ♾️
6:58
Bro Code
Рет қаралды 302 М.
ДЕНЬ РОЖДЕНИЯ БАБУШКИ #shorts
00:19
Паша Осадчий
Рет қаралды 3,9 МЛН