Created
September 19, 2014 15:08
-
-
Save thomasballinger/18095c22fa067147dd52 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### current bpython session - file will be reevaluated, ### lines will not be run | |
class Mapping(object): | |
def __init__(self): | |
self.dict = {} | |
def add_key_value_pair(self, key, value): | |
self.dict[key] = value | |
def get_value(self, key): | |
return self.dict[key] | |
def remove_key(self, key): | |
del self.dict[key] | |
m = Mapping() | |
m.add_key_value_pair('hello', 10) | |
m.get_value('hello') | |
### 10 | |
### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment