Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In [91]: class myclass:
- ....: def __init__(self):
- ....: self.f_name = "david"
- ....: def f_name(self, first_name):
- ....: self.f_name = first_name
- ....: print "Your first name is: ", self.f_name
- ....:
- In [92]: bio = myclass
- In [93]: bio.f_name("frank")
- ---------------------------------------------------------------------------
- TypeError Traceback (most recent call last)
- /home/oquidave/Documents/<ipython-input-93-d68dda092f63> in <module>()
- ----> 1 bio.f_name("frank")
- TypeError: unbound method f_name() must be called with myclass instance as first argument (got str instance instead)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement