Advertisement
TonyMo

character_test.py

Mar 12th, 2021
907
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. # character_test.py
  2.  
  3. from character import Character
  4. # character.py contains code functions used here
  5.  
  6. dave = Character("Dave", "A smelly zombie")
  7. dave.describe() # this prog code is in character.py
  8.  
  9. dave.talk()   # dave not talking 'cos set_conversation is still nul
  10.  
  11. # add attribute to dave.set_conversation.
  12. dave.set_conversation("Do you want a bite?")    #dave's opening words.
  13. dave.talk()
  14. # now dave speaks.
  15.  
  16. dave.fight("knife")
  17.  
  18. '''
  19. >>>
  20. Dave is here!
  21. A smelly zombie
  22. Dave doesn't want to talk to you
  23. [Dave says]: Do you want a bite?
  24. Dave doesn't want to fight with you and your knife !
  25. >>>
  26. '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement