Implementing Goblin game in Python 2.7 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Implementing Goblin game in Python 2.7

This is the example from the Python course / Object-Oriented Programming / 8 A Simple Game. I'd not been successful in in implementing this in Python 2.7. I've made some changes but it still doesn't work properly. Here's my code: https://gist.github.com/amartin1911/e8d89934a0fdea662602a1192f579534 And here's the output with the TypeError after some inputs: https://gist.github.com/amartin1911/47712e3680d78a9782e994fcaeb4e44f Any help would be appreciated. Thanks in advance.

18th Oct 2017, 11:40 PM
Álvaro Martín Callejas Herrera
Álvaro Martín Callejas Herrera - avatar
1 Answer
+ 4
Line 28: You have a typo: health_line should be healt_line (if you want it to match everything else) Line 33: Unindent the return statement 4 spaces (otherwise None is returned for all conditions except <= 0)
19th Oct 2017, 12:27 AM
Kirk Schafer
Kirk Schafer - avatar