I'm working on a simple program that asks for 3 inputs and if all 3 inputs match then a welcome message is printed. (Initials == YNH, Age == 42, DOB == 1/27/74).
Additionally, the length of the user's name (YoungNathanHeather) is printed as well as an input (color) that prints one of three different strings.
I am having a problem where all three if statements are true and printing their strings even though the variable (color) is different when I input blue, pink, and yellow.
Maybe I am missing something huge here with nesting a bunch of if statements, but does anyone have an idea whats going on here ? I expect to input "Yellow" and see only one string print.
#checks if inputted information matches criteria.
#if all inputted information matches variable criteria
#(Initials == YNH, Age == 42, DOB == 1/27/74), then
#prints a Welcome message for the user.
if Initials == 'YNH':
if Age == '42':
if DOB == '1/27/74':
print('Welcome Young Nathan Heather')
print('Did you know that your name has ' +str((len('YoungNathanHeather'))) +' letters.')
#Asks for a color and prints a response based on if the color is pink, yellow, or blue
color = input("If you could describe your mood in a color, what would it be ?")
if color == 'blue' or 'Blue':
print('According to my research Master, Blue and Yellow together makes green. Green seems to be equal to money.')
elif color == 'pink' or 'Pink':
print('According to my research Master, Pink attracts women or makes a human into a women. Whatever comes first.')
elif color == 'yellow' or "Yellow":
print('According to my research Master, Yellow indicates a "mellow" mood. Prolong this mood if feasible.')
else:
print("My apologies Master. My research is shallow and I am not yet familiar with that mood's \"color\"")
else:
print('Sorry, Wrong Credentials Entered')
else:
print('Sorry, Wrong Credentials Entered')
else:
print('Sorry, Wrong Credentials Entered')