Complete the code to check if a number is positive.
num = 5 if num [1] 0: print("Positive number")
The condition num > 0 checks if the number is positive.
Complete the code to check if a number is positive and even.
num = 4 if num > 0 and num [1] 2 == 0: print("Positive even number")
The modulo operator % checks if the number is divisible by 2 with no remainder, meaning it is even.
Fix the error in the nested if statement to check if a number is positive and less than 10.
num = 7 if num > 0: if num [1] 10: print("Number is positive and less than 10")
The inner condition should check if num < 10 to confirm it is less than 10.
Fill both blanks to print if a number is positive and even.
num = 8 if num [1] 0: if num [2] 2 == 0: print("Positive even number")
The first blank checks if the number is greater than zero. The second blank uses modulo '%' to check evenness.
Fill all three blanks to print if a number is positive, even, and less than 20.
num = 16 if num [1] 0: if num [2] 2 == 0: if num [3] 20: print("Positive even number less than 20")
The first blank checks if number is greater than zero, the second uses modulo '%' to check evenness, and the third checks if number is less than 20.