I was a bit curious if there's something that I was missing in the code below,
The logic I want the user to enter either "Y"
or "H"
or "E"
, which I would like to transfer to another class using a return
statement. I use the else
part to return boolean False
if otherwise.
There is a while
loop that would send the control back to this same function until the user enters the required value.
On running the program it never enters the else
part no matter what input is received.
def getUserIngameOption(self):
userIngameOption=raw_input("Please Enter Y -> for Turn | H -> Hint | E -> to End")
userDesc=userIngameOption.upper()
if not ( userDesc==("Y") or ("H") or ("E")):
print "Mate PLEASE JUST TYPE WHATTTT is asked for !! not this",userDesc
return False
else:
self.userOpt=userDesc
print "This is detail that you got>>>",self.userOpt
return self.userOpt