Mar-05-2018, 12:07 AM
its not about condensing the code. Its about restructuring it. While restructuring it you will also condense it. But condensing it should not be the main goal....organization is.
Also another thing i see now that i copied and paste the code is you should use 4 spaced indents as its the normal. More info here
https://www.python.org/dev/peps/pep-0008/
an example of the beginning class structure
Also another thing i see now that i copied and paste the code is you should use 4 spaced indents as its the normal. More info here
https://www.python.org/dev/peps/pep-0008/
an example of the beginning class structure
class Character: def __init__(self, name, health, maxhealth, tdmg, sdmg): self.name = name self.health = health self.maxhealth = maxhealth self.tdmg = tdmg self.sdmg = sdmg hunter = Character('Hunter', 20, 20, '3-5', '4-6') knight = Character('Knight', 25, 25, '5-7', '1-3') heavy = Character('Heavy', 30, 30, '5-7', '3-5')
Recommended Tutorials: