https://codetofun.com/python/power-of-3/
Python Program to Check Power of 3