QUESTION IMAGE
Question
when searching you will need to compare a data value to the desired value. which line of code returns true when the item is equal to five?
item = 5
item == 5
item != 5
item is 5
In programming, the single - equal sign = is for assignment. The double - equal sign == is a comparison operator that checks for equality and returns true or false. The != operator checks for inequality. In Python, is checks if two objects are the same object in memory (not just equal in value in most cases). So, to check if a variable item is equal to the value 5 and return true when it is, we use item == 5.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
item == 5