#coding=utf-8 d={'title':'python web development','year':2008} print d.setdefault('pub','addision wesley') del d['pub'] print len(d)