Answer to Question #308401 in Python for sadia

Question #308401

Write a Python program that reads a number and finds the sum of the series of 1 +11 + 111 + 1111 + ….+N terms.


1
Expert's answer
2022-03-09T12:32:54-0500
list1 = []
j = int(input(''))
for k in range(1,j+1):
    i = '1' * k
    list1.append(i)
sumi = 0
for l in list1:
    sumi = sumi + int(l)
print(sumi)


5
12345

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS