Take note of line 25 and line 34.
when this code is ran, the first block of code (line 25 is in this block) requires parenthesis around the multiple choices.
when lower down in my code (line 34) it requires no parenthesis in order for it to accept the words that are allowed.
im using python 3x, and pycharm.
why does the top part require parenthesis in order for it to choose the exact words that im allowed (guy, GUY, boy, bo, b).
and the bottom part require NO parenthesis to choose the same words, pchoice == 'left' or 'LEFT' or 'L' or 'l" or 'Left':
shouldnt it be one or the other? why would the first part of code need parenthesis, and not the second part?
when this code is ran, the first block of code (line 25 is in this block) requires parenthesis around the multiple choices.
when lower down in my code (line 34) it requires no parenthesis in order for it to accept the words that are allowed.
im using python 3x, and pycharm.
why does the top part require parenthesis in order for it to choose the exact words that im allowed (guy, GUY, boy, bo, b).
and the bottom part require NO parenthesis to choose the same words, pchoice == 'left' or 'LEFT' or 'L' or 'l" or 'Left':
shouldnt it be one or the other? why would the first part of code need parenthesis, and not the second part?
class Player: def __init__(self,name,age,gender): self.name = name self.age = age self.gender = gender def getInfo(self): print("Player Info") print(self.name) print(self.age) print(self.gender) def getHealth(self): return self.health def eatApple(self): self.health = self.health + 15 return self.health ur_name = input("What is your name? ") print("Hi, {}.".format(ur_name)) ur_age = input("How old are you? ") ur_gender = input("guy or girl?") if ur_gender == ('guy' or 'GUY' or 'boy' or 'bo' or 'b'): print("alright, dude") else: print("k, girl") p1 = Player(ur_name,ur_age,ur_gender) p1.getInfo() p1.health = random.randint(80,100) p1.getHealth() pchoice = input("Looks like we can go right of left, where should we go? ") if pchoice == 'left' or 'LEFT' or 'L' or 'L' or 'Left': print("left") else: print("we go right")