human
What is a code to find sum of the series 1 + 22 + 333 + 4444 + given the following:
Find sum of the series 1 + 22 + 333 + 4444 + ... ... upto n terms | Function to calculate sum.
Return sum.
driver code"
How can the above be solved in Python?
assistant
#Here is code to find sum of the series 1 + 22 + 333 + 4444 + .
 def solve_sum ( n ) :
	return ( pow ( 10 , n + 1 ) * ( 9 * n - 1 ) + 10 ) / pow ( 9 , 3 ) - n * ( n + 1 ) / 18
n = 3
print ( int ( solve_sum ( n ) ) )