How to Add Multiple Items in Dictionary|update Method in Dictionary|Dictionary in Python Tutorial

preview_player
Показать описание
How to Add Multiple Items in Dictionary|update Method in Dictionary|Dictionary in Python Tutorial
This video is part of Python tutorial for beginners in Hindi.In this video,i have covered how to add multiple items in dictionary.To add multiple itesms,we will use update() method and manually also we can add items.Let's see..

You will learn:-
1) dictionary in python
2) update() method
3) adding items in dictionary

Hello guys,welcome to code-yug to build your computer science skills.Here,you will learn programming tutorials and computer science tutorials from basics to advanced.

source code :-
Thanks for watching this video
Subscribe codeyug for more programming tutorials.
About this channel:-
This channel provides free tutorials on programming,coding,web development.There are programming tutorials which covers from basics to advanced absolutely in hindi.

Our social links:-
creator:-
------shantanu kejkar-------
#python #python3 #codeyug #programming #coding #tutorial
Рекомендации по теме
Комментарии
Автор

I learned a lot from your videos and I update my skill a lot each and every thing is in depth with proper understand Thanks! 😊

dakshataramteke
Автор

after the "if" statement we can write :
else:
if roll in student :
x=input("Enter a new rule:")
student[roll]=marks



ayat
Автор

d = {}
loop = 0
students = int(input("How many number of students: "))

while loop < students:
roll = int(input('Enter the roll number: '))
marks = int(input('Enter the marks: '))

if roll in d:
continue
else:
d[roll] = marks
loop += 1

print(d)

vaibhavmagar
Автор

Here one doubt if the dict is unordered, howcome the elements are being added sequentially in update() and last element deleted everytime through popitem()?

vibhudxt
Автор

num = int(input("how many students you want to add in data :--"))
num = list(range(num))

for i in num:
print(i)
roll = input("enter tha roll number of student that you want to add :--")
marks = float(input(F"Enter the marks of roll number{roll} :--"))
if roll not in dict_1:
dict_1.update({roll:marks})
else :
print(" sorry ! this roll number alredy present in data ")
num.append(1)
print(dict_1)

AnonamousUser
Автор

What's this?? It's awful explanation!

RG-FL
welcome to shbcf.ru