Dictionary

//----------methods-------------------------

clear(),  copy(), fromkeys() , get()

pop(),popitems(),update()

//-----------------------------------

mydict={}

for value in mydict.values():

    print(value)

//-----------------------------------

for key in mydict.keys():

print(key)

//---------------------------------

for dict in mydict.items()

    print(dict)

//------------------------------------

if keyname in mydict

//---------------------------------

if keyvalue in mydict.values()

//-----------------------------------


//-----

fromkeys

new_user= {}.fromkeys(['name', 'score', 'email'], 'unknown')

print(new_user) 

{'name':'unknown', 'score':'unknown', 'email':'unknown'....

new_user = {}.fromkeys(range(1, 10), 'unknown')

print(new_user)


{1: 'unknown', 2: 'unknown', 3: 'unknown', 4:.....  . . ..   }

//------------------

get()


student_scores = {"Alice": 85, "Bob": 92, "Charlie": 78}

score = student_scores.get("Alice")

o/p: 85

//----------------------------------------------------------------------