QUESTION IMAGE
Question
part 5: comparison operators
understanding the symbols
operator meaning example
== equals age == 18
!= not equals name != \john\
greater than score > 80
< less than temp < 32
= greater than or equal grade >= 90
<= less than or equal speed <= 55
practice exercise 7: operator detective
for each condition, write true or false based on the given values:
given: age = 16, name = \sarah\, score = 85
- age == 16:
- age >= 18:
- name == \sarah\:
- name != \john\:
- score > 90:
- score <= 85:
- age < 20:
Step1: Check equality of age
Given age = 16, and condition is age == 16, so it's True.
Step2: Check if age is greater than or equal to 18
Given age = 16, 16 < 18, so age >= 18 is False.
Step3: Check equality of name
Given name = "Sarah", and condition is name == "Sarah", so it's True.
Step4: Check if name is not equal to "John"
Given name = "Sarah", so name != "John" is True.
Step5: Check if score is greater than 90
Given score = 85, 85 < 90, so score > 90 is False.
Step6: Check if score is less than or equal to 85
Given score = 85, so score <= 85 is True.
Step7: Check if age is less than 20
Given age = 16, 16 < 20, so age < 20 is True.
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
- True
- False
- True
- True
- False
- True
- True