Flow controls: Conditions · 12 / 22 Exercise Easy

Check even numbers

Objective

Create a Python program that uses the conditional operator (and) to assign a value to a boolean variable. Assign True if both numbers entered by the user (x, y) are even, and False if either of them is odd. Finally, display the value of the variable on the screen.

Input
2
2
Output
Are both numbers even? True

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise