#!/usr/bin/env python3
#=====================================================================================
# Python dictionaries 
#=====================================================================================
print("Content-Type: text/html \n")     #http header with newline char (required for web)


stuff1 = {}
stuff2 = {'work':'weekday', 'fun':'weekend'}   
stuff3 = {'first':'Sam', 'last':'Sultan', 'gender':'M', 1:'one'}    #keys can be of different data types

print('<pre>')                                                      #to print better on the web

print('Printing empty stuff1 dictionary:', stuff1)
print()

print('Printing stuff2 dictionary.......... :', stuff2)
print('Printing number of elements in stuff2:', len(stuff2))        #an element is a name/value pair
print()

print('Printing the entire stuff3 dictionary..:', stuff3)
print("Printing the content of element 'first':", stuff3['first'])
print("Printing the content of element 1 .....:", stuff3[1])
stuff3['first'] = 'Samuel'                                          #change element
stuff3['age']   = 50                                                #add new element
stuff3[2]       = 'two'                                             #add new element
del stuff3[1]                                                       #delete element
print('After add, change and delete .........:', stuff3)
print()