Menu

Relational Operators

Card 1 of 18 0 got it 0 still learning
Question
TapClick or press space to see the answer
Answer
All 18 cards in this set
What is the name for operators that compare two values, such as == and != ?
Comparison operator
What is meant by the operator ==?
It checks whether two values are equal
Which operator gives the result True when two values are not the same?
!=
What is meant by the operator >= ?
It is True when the left value is at least the right value
What is the name for the result of a comparison, which can only be True or False?
Boolean
What is meant by a boundary value in a comparison?
The value exactly on the limit being tested
What is meant by the operator < ?
It is True when the left value is smaller than the right value
In Python, what happens in the statement x = 5?
It stores the value 5 in the variable x
Which pair of symbols is NOT a valid comparison operator in Python?
=< and =>
With x = 12 and y = 8, what is the value of x * 2 > y * 3?
False
A program compares a word typed by the user with 'Yes' using word == 'Yes'. The user types 'yes'. What is the result?
False, because == is case sensitive
The user types 10 when this program runs. What is the result of the comparison?
False, because the input is a string
With score = 45, what is stored in the variable passed by the statement passed = score >= 50?
The Boolean value False
A bag can hold a maximum load of 5 kg. Which condition is True for every load the bag can hold?
Weight <= 5
What does this program print?
False
A loop keeps repeating while the condition answer != 'Correct' is True. Which value of answer makes the condition False?
'Correct'
With x = 4 and y = 9, which comparison gives True?
X < y
What does this program print?
Pass is printed