Sobes.tech
Junior — Senior

Output only numbers divisible by three

livecode

Task condition

It is necessary to modify the function so that it returns only those numbers that are divisible by 3 without a remainder.

def get_divisible_by_three(n: int = 10) -> list[int]:
    return [num for num in range(n) if num % 3 == 0]