I created this jokey therapy bot (not serious) that in a session will learn new words if they're not already in the two lists. In the def learning_response there is an else statement:
else:
print('Your emotions are too complex for me @{}"£$"${%£$')
But it doesn't actually get expressed. Does anyone have an idea why?
Any advice would be much appreciated!
EDIT: People have explained that the problem is with the 'or' part of the function. I can appreciate that I need to change it but don't completely understand why. Any ideas?
===========================================================================
happy_response = ['good', 'great', 'brilliant','happy','excited','amazing']
unhappy_response = ['not good','bad','shit','unhappy','crap','low']
running = True
while running==True:
how_you = input('How are you today? ')
if how_you == 'Quit':
break
#how_scale = input('On a scale of 1-10..1 being very low, 10 being great..how are you feeling? ')
def positive_response():
print('Good. Thatll be £50 please')
def supportive_response():
print('Oh well....ever thought going skipping? That always cheers sad bot up.')
def learning_response():
happy_or = input('I dont understand. Is this a happy or unhappy response? ')
if happy_or == 'happy' or 'Happy':
happy_response.append(how_you)
print('Thank you. Love bot has learned a new positive word and become even more powerful.')
elif happy_or == 'unhappy' or 'Unhappy':
unhappy_response.append(how_you)
print('Thank you. Love bot has learned a new negative word and become even more powerful.')
else:
print('Your emotions are too complex for me @{}"£$"${%£$')
def assess_mood():
if how_you in happy_response:
positive_response()
elif how_you in unhappy_response:
supportive_response()
else:
learning_response()
assess_mood()
print('Ended...that will be £50 please')