Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. def is_divisible(x, y):
  2. if x % y == 0:
  3. return True
  4. else:
  5. return False
  6.  
  7. def is_power(a, b):
  8. if is_divisible(a,b):
  9. print(b / a)
  10. is_power(a / b, a)
  11. else:
  12. print(a == 1)
  13. return a == 1
  14.  
  15. print(is_power(2,1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement