Advertisement
skashminzim

as8

May 7th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. n=int(input('N='))
  2. a=1
  3. sum=0
  4. print('The series is',end=' ')
  5. for i in range(1,n):
  6.     print (a,end='+')
  7.     sum=sum+a
  8.     a=a*2
  9. print(a)
  10. print('The sum of the series is %d'%(sum+a))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement