Lesson guide
What this Python exercise practices
Check Multiple of 3 and 5 is a beginner practice lesson that focuses on functions, parameters, return values. It is designed to be solved in about 10 minutes with examples, starter code, and test feedback.
Prerequisites
- Python variables
- Function parameters
- Return values
Difficulty and time
- Level
- Beginner
- Estimated time
- 10 minutes
Practice path
Summary
Determine whether a number is a multiple of both 3 and 5.
Problem statement
Given an integer n, return True if n is divisible by both 3 and 5, otherwise return False. This is equivalent to checking divisibility by 15. Handle zero and negative numbers correctly.
Task
Implement a function that returns True when a number is divisible by both 3 and 5 (i.e., divisible by 15).
Examples
Example
Input
15
Output
True
Explanation
15 is divisible by both 3 and 5.
Input format
A single integer n.
Output format
A boolean: True if n is divisible by both 3 and 5, otherwise False.
Constraints
-10**9 <= n <= 10**9. Input will be integer.
Samples
Sample input 0
10
Sample output 0
False
Explanation 0
10 is divisible by 5 but not by 3.
AI assistant
Ask me anything!
Need help? I can explain the core idea behind this problem, review your current code, and give targeted hints. Use “Teach Theory” for the concept, “Get AI hint” for a quick scaffold nudge, or ask a specific question below.
Chat history is temporary and will not be saved.
Free preview includes 1 Teach Theory response and 1 AI hint per unlocked preview lesson.