Menu

Sign in to track your progress and unlock all features.

Theme style

Log in

Full lesson preview

Check Divisible by Three

Determine whether a given integer is divisible by 3.

Python practice6 minControl Flow (If–Else Logic)BeginnerLast updated March 15, 2026

Problem statement

Given an integer n, return True if n is divisible by 3, otherwise return False. Zero is considered divisible by 3. The function should accept negative integers as well.

Task

Write a function that returns True if an integer is divisible by 3, otherwise False.

Examples

Example

Input

9

Output

True

9 % 3 == 0, so 9 is divisible by 3.

Input format

A single integer n.

Output format

A boolean: True if n is divisible by 3, otherwise False.

Constraints

-10**9 <= n <= 10**9 (typical integer range). Only integers will be provided.

Samples

Sample 1

Input

10

Output

False

10 is not divisible by 3.