Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # character_test.py
- from character import Character
- # character.py contains code functions used here
- dave = Character("Dave", "A smelly zombie")
- dave.describe() # this prog code is in character.py
- dave.talk() # dave not talking 'cos set_conversation is still nul
- # add attribute to dave.set_conversation.
- dave.set_conversation("Do you want a bite?") #dave's opening words.
- dave.talk()
- # now dave speaks.
- dave.fight("knife")
- '''
- >>>
- Dave is here!
- A smelly zombie
- Dave doesn't want to talk to you
- [Dave says]: Do you want a bite?
- Dave doesn't want to fight with you and your knife !
- >>>
- '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement