human
Give me a code to largest Even and Odd N and the other steps required given the following:
Largest Even and Odd N | Function to print the largest N - digit even and odd numbers of base B.
Initialise the Number.
If Base B is even , then B ^ n will give largest Even number of N + 1 digit.
To get even number of N digit subtract 2 from B ^ n.
To get odd number of N digit subtract 1 from B ^ n.
If Base B is odd , then B ^ n will give largest Odd number of N + 1 digit.
To get even number of N digit subtract 1 from B ^ n.
To get odd number of N digit subtract 2 from B ^ n.
Driver 's Code.
Function to find the numbers"
How can the above be solved in Python?
assistant
#Here is code to largest Even and Odd N and the other steps required.
 def findNumbers ( n , b ) :
	even = 0 ;
	odd = 0 ;
	if ( b % 2 == 0 ) :
		even = pow ( b , n ) - 2 ;
		odd = pow ( b , n ) - 1 ;
	else :
		even = pow ( b , n ) - 1 ;
		odd = pow ( b , n ) - 2 ;
	print ( " Even ▁ Number ▁ = ▁ " , int ( even ) ) ;
	print ( " Odd ▁ Number ▁ = ▁ " , int ( odd ) ) ;
if __name__ == ' _ _ main _ _ ' :
	N = 2 ;
	B = 5 ;
	findNumbers ( N , B ) ;