Question: Using python. Could you help me solve the problem Thanks! Write a function onesum which takes one input, n, and finds the sum: 111+111+1111+up to

Using python. Could you help me solve the problem Thanks!

Using python. Could you help me solve the problem Thanks! Write a

Write a function onesum which takes one input, n, and finds the sum: 111+111+1111+up to n digits of 1 For example: Question 4 Incorrect Mark 0.00 out of 1.00 print (onesum( 1) r Flag question Which is 1-1 >print (onesum( 2)) 12 Which is 1 +11-12 >>>print (oneSum( 3)) 123 Which is 1 +11+ 111 123. Hint: think about each element of the sum (1,11, 111, for example) represented as a sum of powers of 10: 111 10A0+10A1+10A2 1+10+100 Answer: (penalty regime 0 %) 1def oneSum(n): um e temp1 for num in range (1,n temp temp 10+1 umsum+temp print temp) return sum Check Syntax Error(s) Sorry: IndentationError: expected an indented block (prog.python3, line 6) Incorrect Marks for this submission: 0.00/1.00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!