logo

AQA A-Level Computer Science practice

Write a Python 3 relational expression that evaluates to True when temperature is greater than or equal to 18. Then state the result when temperature has the value 17.

Try the question first, then check the answer and practise the same topic again.

At a glance

Question

Type

practice

Style

Topic

Programming

Exam-style question

Try this first

Write a Python 3 relational expression that evaluates to True when temperature is greater than or equal to 18. Then state the result when temperature has the value 17.

Answer and explanation

Concise answer

The expression is temperature >= 18.

Why this is correct

The >= operator tests both conditions represented by 'greater than or equal to'. Since 17 is not greater than 18 and is not equal to 18, the result is False.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions