Six Check

This check helps you practice several conditions at once: a direct value, a sum, and a difference. Write a function love6 that takes two integers a and b. Return True if either number is 6, if their sum is 6, or if the absolute difference between them is 6. Otherwise, return False.

Примеры

Ввод
6, 4
Вывод
True
Ввод
4, 5
Вывод
False
Ввод
1, 5
Вывод
True

Нужно реализовать

def love6(a: int, b: int) -> bool:

Теги

math
PostgreSQLv16

Tu sa zobrazí výsledok spustenia kódu

Visible tests
1
Input
6, 4
ExpectedTrue
2
Input
4, 5
ExpectedFalse
3
Input
1, 5
ExpectedTrue
4
Input
3, 3
ExpectedTrue
5
Input
1, 7
ExpectedTrue
6
Input
2, 5
ExpectedFalse
Focus radio
Paused · SomaFM · Fluid