#!/usr/bin/env python
# coding: utf-8

# In[2]:


#1
d={}
a=dict(d)
type(a)


# In[3]:


#2
d={'foo':42}
d


# In[ ]:


#3
 .List are represented by [] while dictionaries by {}.
 . Elements can be of any datatypes while key values in dictionary cant be mutable datatypes
 . Elements in lists are accessed by index values while key values are used in dictionary.
. Lists are ordered while dictionary is unordered.
. Lists size can be altered while dictionary size remains same 


# In[6]:


#4
Error occurs as foo is not a key to the dictionary spam


# In[7]:


#5
spam[key] returns value.So cat is value
spam.keys returns the keys of dictionary.So cat is key


# In[11]:


#6
Both expressions return values.


# In[27]:


#8
module - ppprint
function name - pprint.pprint(dict_name)

