Collectoin In Python part -5

For professionals and  Freshers



 
dict : dictionary : 

if you want to represent group of object as a key value pair the we should go for dict

Example : 

roono    name
101        raju
102        ramlal
103       babulal


{} brackets indicate that it is dictionary :

question :
 {} bracket also indication  of list then how we identify weather it is dictoinary or list?

if we write data in sequence in {} then it is list
if you added data in key value pair then it is dictionary
and if you create {} bracket then it  is dictionary

question : if  empty bracket is {} dictionary  then how we can create empty set
 simple :
s=set();

 d={100:'govind' , 101:'ramlal',103:'babulal'}

In set duplicate keys not allowed values can be duplicated 

Comments

Popular posts from this blog

Filter In Javafx

Kotlin with StandAlone Complier