Java, .NET, PHP, PYTHON, ANGULAR, .NET, ML, Data Scince, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"



Dictionary is used to contain data using key=>value pair .Key is used to provide unique identity and value is used to provide storage.

dictionary always will be declared by { }

student = {'rno':1001,'sname':'manish kumar','branch':'cs'}

here rno, same and branch is the key of a dictionary object.

the dictionary is immutable object means we can change the value of dictionary using the key.


student = {'rno':1001,'sname':'manish kumar','branch':'cs','fees':15000}
for k in student:
    print("key is "+k+" value is "+str(student[k]))

student['sname']='ravi'
#del student['sname']
#print(student['sname'])

student.update({'sem':'5th'})

print(student)











Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post