Avik Ghose <avikghose at yahoo.co.in> writes: > if 'tom' in phone_book.keys(): > #duplicate entry; Don't do it that way! That builds up a whole list from scratch containing all the keys, and then searches the list for 'tom'!!! There was just a thread about this :). Instead, use: if 'tom' in phone_book: ... or if phone_book.has_key('tom'): ...