Question: Python 3 Write a function oneSum which takes one input, n, and finds the sum: For example: >>> print (oneSum( 1)) which is 1-1. >>>
Python 3 
Write a function oneSum which takes one input, n, and finds the sum: For example: >>> print (oneSum( 1)) which is 1-1. >>> print (oneSum( 2)) 12 Which is 111 12. print (oneSum(3 ) 123 Hint: think about each element of the sum (1, 11, 111, for example) represented as a sum of powers of 10: 111-100 + 10^1 + 10^2= 1 + 10 + 100 For example: Test Result print(oneSum(3))123 print (oneSum(4)) 1234 print(oneSum(e)) print(oneSum(1) 1 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
