Python 2 examples taken while learning SPSE
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

28 lines
417 B

#!/usr/bin/python
# -*- coding: utf-8 -*-
myBio = {'name' : "unknown", 'age' : 666, 'hobby' : 'hacking'}
print myBio
myBio.has_key('hobby')
myBio.has_key('notinside')
myBio.values()
print myBio.get('age')
del myBio['age'] # Delete age
print myBio
dict_tuple = myBio.items() # into tuples
print dict_tuple
'name' in myBio
print myBio.has_key('hobby')
print dir(myBio)
help(myBio.update)
help(myBio.has_key)