Skip to content

Commit

Permalink
Replace if-else statement with not operator
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyHilly committed Oct 22, 2023
1 parent 7aa5d49 commit dc2d5e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __repr__(self) -> str:

class Herbivore(Animal):
def hide(self) -> None:
self.hidden = False if self.hidden else True
self.hidden = not self.hidden

def bitten(self) -> None:
self.health -= 50
Expand Down

0 comments on commit dc2d5e7

Please sign in to comment.