human
Write me a code to find the sum of digits of a number at even and odd places and the other steps required given the following:
Find the sum of digits of a number at even and odd places | Function to find the sum of the odd and even positioned digits in a number.
To store the respective sums.
Converting integer to string.
Traversing the string.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to find the sum of digits of a number at even and odd places and the other steps required.
 def getSum ( n ) :
	sumOdd = 0
	sumEven = 0
	num = str ( n )
	for i in range ( len ( num ) ) :
		if ( i % 2 == 0 ) :
			sumOdd = sumOdd + int ( num [ i ] )
		else :
			sumEven = sumEven + int ( num [ i ] )
	print ( " Sum ▁ odd ▁ = ▁ " , sumOdd )
	print ( " Sum ▁ even ▁ = ▁ " , sumEven )
if __name__ == " _ _ main _ _ " :
	n = 457892
	getSum ( n )