Oct-06-2018, 03:00 PM
Hi!
My code:
and the output (please focus on the second execution)
Can anyone please spot my error?
My code:
feeling = input('How are you?\n') if feeling.lower() == 'great': print('I feel great too.') elif feeling.lower == 'bad': print('I hope the rest of your day will be good.') else: print('Take it easy!')
and the output (please focus on the second execution)
Output:Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>>
RESTART: C:/Users/kr-ga/AppData/Local/Programs/Python/Python37-32/BOOK_automate_the/Chapter 6/test2.py
How are you?
great
I feel great too.
>>>
RESTART: C:/Users/kr-ga/AppData/Local/Programs/Python/Python37-32/BOOK_automate_the/Chapter 6/test2.py
How are you?
bad
Take it easy!
>>>
My question is apparently, why does my program print 'take it easy', instead of 'I hope the rest of your day will be good.', when the input is 'bad'?Can anyone please spot my error?