17. Review: Functions


Replace this line with your code. 

i dont know what am i doing wrong ! ive seen other posts and they are the same as mine ! any help please !


The problem is with your comparison operator. A single = is used to set the value of a variable, whereas == is used to compare whether two values are equal. In this case you want to look to see if s is equal to "yes" or "no".


You seem to confuse the operators. Let's review them:

This operator:


Assigns a value to a variable like this, var = variable. It is the same as saying this is that, which in Python translates to this = that. The second operator:


Is the same as the equal to sign we use in math. It is the same as 1+1 = 2 in math, but in Python it would be 1+1 == 2. In you if, elif statements, you want to use the second one, as you are checking if the variable "s" is equal to ( aka this operator ==) yes or no. Replace your code with the right operator, and you should be good. Message me if it still doesn't make any sense.

Hope that helps! :slight_smile:

-- @chipjumper36731


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.