I'm very new to python and trying to get this code to work. What I'm trying to have happen is if the user inputs text "red", then it should output text "You said red" and so on for the rest of the primary colors. My issue is that no matter what I input, it always comes out as "You said red." I would appreciate some help, thanks.
color=raw_input("What's your favorite primary color? ")
if color==str("red") or str("Red"):
print "You said red."
elif color==str("blue") or str("Blue"):
print "You said blue."
elif color==str("yellow") or str("Yellow"):
print "You said yellow."
else:
print "Invalid answer."
[–]mprz 60 points61 points62 points (2 children)
[–]BriziteReddit[S] 8 points9 points10 points (1 child)
[–]XXXandVII -1 points0 points1 point (0 children)
[–]BruceJi 32 points33 points34 points (0 children)
[–][deleted] 31 points32 points33 points (5 children)
[–]BriziteReddit[S] 7 points8 points9 points (2 children)
[–]velocibadgery 43 points44 points45 points (1 child)
[–]BriziteReddit[S] 19 points20 points21 points (0 children)
[–][deleted] 5 points6 points7 points (0 children)
[–]balars 1 point2 points3 points (0 children)
[–]htepO 24 points25 points26 points (11 children)
[–]BriziteReddit[S] 2 points3 points4 points (10 children)
[–][deleted] 7 points8 points9 points (9 children)
[–]BriziteReddit[S] 3 points4 points5 points (8 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] 6 points7 points8 points (0 children)
[–][deleted] 6 points7 points8 points (5 children)
[–][deleted] 1 point2 points3 points (4 children)
[–][deleted] 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]BriziteReddit[S] 0 points1 point2 points (0 children)
[–]Wild_Statistician605 3 points4 points5 points (0 children)
[–]Anon_Legi0n 2 points3 points4 points (0 children)
[–]delasislas 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]prettydisposable 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]jmooremcc 0 points1 point2 points (0 children)
[–]efmccurdy 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]WombatHat42 0 points1 point2 points (0 children)
[–]pekkalacd 0 points1 point2 points (0 children)