Write a Python program that reads a number and finds the sum of the series of 1 +11 + 111 + 1111 + β¦.+N terms.
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
Comments
Leave a comment