So I have the code:
if bulletaloc == bulletcount or bulletbloc == bulletcount and bulletcount % 2 == 0:
print("Ow!", paname + "'s guts were spilled all over the floor")
if bulletaloc == bulletcount or bulletbloc == bulletcount and bulletcount % 2 == 1:
print("Whoops!", pbname, "just got killed...")
And what i want it to do is when bulletaloc == bulletcount or when bulletbloc == bulletcount, AND, this applies to both conditions…When bulletcount%2 == 9, print the 1st message. So when either of the first two statements are true (bulletaloc… and bulletbloc…, AND the third is true, print the message.)
What ends up happening is, no matter what, both messages print! How do i fix this???
You should learn about precedence of
orandand:I would refactor it like this: