Question #308401

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


Expert's answer

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!

LATEST TUTORIALS
APPROVED BY CLIENTS