human
Representation of a number in powers of other | Python3 program to check if m can be represented as powers of w ..
If m is not zero means , it can 't be  represented in terms of powers of w..
Driver code"
How can the above be solved in Python?

Write me a code to representation of a number in powers of other and the other steps required?
assistant
#Here is code to representation of a number in powers of other and the other steps required.
 def asPowerSum ( w , m ) :
	while ( m > 0 ) :
		if ( ( m - 1 ) % w == 0 ) :
			m = ( m - 1 ) / w ;
		elif ( ( m + 1 ) % w == 0 ) :
			m = ( m + 1 ) / w ;
		elif ( m % w == 0 ) :
			m = m / w ;
		else :
	return ( m == 0 ) ;
w = 3 ;
m = 7 ;
if ( asPowerSum ( w , m ) ) :
	print ( " Yes " ) ;
else :
	print ( " No " ) ;