Complete the code to print "Yes" if the number is greater than 10.
number = 15 if number [1] 10: print("Yes")
The condition should check if number is greater than 10 using the > operator.
Complete the code to print "Even" if the number is divisible by 2.
number = 8 if number [1] 2 == 0: print("Even")
The modulo operator % gives the remainder. If number % 2 == 0, the number is even.
Fix the error in the if statement to check if age is at least 18.
age = 20 if age [1] 18: print("Adult")
The correct operator to check if age is greater than or equal to 18 is >=.
Fill both blanks to print "Positive" if x is greater than 0 and "Non-positive" otherwise.
x = 5 if x [1] 0: print("Positive") else: print("[2]")
The condition checks if x is greater than 0 using >. If not, it prints "Non-positive".
Fill all three blanks to print "Fizz" if number divisible by 3, "Buzz" if divisible by 5, else print the number.
number = 15 if number [1] 3 == 0: print("[2]") elif number [3] 5 == 0: print("Buzz") else: print(number)
Use modulo % to check divisibility. Print "Fizz" if divisible by 3, "Buzz" if divisible by 5.