To view solutions, see the file if-statement.py
in your text editor.
Task:
Given an integer, n
, perform the following conditional actions:
- If
n
is odd, printWeird
; - If
n
is even and in the inclusive range of2
to5
, printNot Weird
; - If
n
is even and in the inclusive range of6
to20
, printWeird
; - If
n
is even and greater than20
, printNot Weird
.
Complete the stub code provided in your editor to print whether or not n
is weird.
Solution:
In if-statement.py
.
Return to navigation list