+ 1

Probably easy fix for most.?

answer = input("running or walking") if input is 'running': answer = True else: answer = False print('Do you like to jog? ', answer) """ Keeps giving "False" as answer when returning input as running. Trying to get it to read "True" when input is "running" but False for every other answer. Thank you for your help """

13th Feb 2018, 2:43 AM
5qu1d
5qu1d - avatar
3 Réponses
+ 8
This is what you want: answer = input("running or walking") if answer == 'running': answer = True else: answer = False print('Do you like to jog? ', answer) You were not checking your inputted answer.
13th Feb 2018, 2:52 AM
John Wells
John Wells - avatar
+ 1
There it is! thank you. I knew it was something simple and when I did it I did it on answer == True. Thank you. I feel much better knowing I wasn't so far off.
13th Feb 2018, 4:04 AM
5qu1d
5qu1d - avatar
+ 1
I also didn't know the ' ' vs " " made such a difference either.
13th Feb 2018, 4:21 AM
5qu1d
5qu1d - avatar