Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def is_divisible(a, b):
- if a % b == 0:
- return True
- return False
- def is_power(a, b):
- if a == b or a == 1:
- return True
- if b == 1 and a != 1:
- return False
- return is_divisible(a, b) and is_power(a / b, b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement