Gasper Posted March 18, 2018 Report Share Posted March 18, 2018 Hi, Lesson 6 contains a simple game where we define a flowControl() function with the following "if...else" statement: if answer == ("yes" or "y"): displayLesson() else: useTime() print("End program") If we run the module and input "yes" the statement is true but if we input "y" then we get the false/else statement. Only the first parameter is considered apparently, if we swap them ("y" or "yes") then "y" would be considered true and "yes" false. I found that if we remove the round brackets from that line and change the statement to: if answer == "yes" or "y": then both parameters work, "yes" and "y" are then considered as a true statement. Not a big deal, just thought i should mention it. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.