+1 vote
in Class 12 by kratos

List one similarity and one difference between List and Dictionary datatype.

1 Answer

+6 votes
by kratos
 
Best answer

Similarity: Both List and Dictionary are mutable datatypes.

Dissimilarity: List is a sequential data type i.e. they are indexed.

Dictionary is a mapping datatype. It consists of key: value pair.

Eg: L =[1,2,3,4,5] is a list

D= {1:”Ajay”,2:”Prashant,4:”Himani”} is a dictionary where 1,2,4 are keys and “Ajay”,Prashant,”Himani” are their corresponding values.

...