Given an integer, write a function to determine if it is a power of three.
code:
class Solution(object):
def isPowerOfThree(self, n):
"""
:type n: int
:rtype: bool
"""
import math
if n<=0:return False
else:
return (math.log10(n)/math.log10(3)).is_integer()