phonebook = {'Beth' : '9102' , 'Alice' : '2341' , 'Cecil' : '3228' }
"Cecil's phone number is %(Cecil)s." %phonebook
"Cecil's phone number is 3258."
The (Cecil) points to that particular key, 'phonebook' directs towards the dictionary.
Thursday, 24 March 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment