Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. x = [int(i) for i in input().split()]
  2. y = [0]*len(x)
  3. for i in range (0, len(x)):
  4. if i == 0:
  5. previous = x[len(x)-1]
  6. else:
  7. previous = x[i-1]
  8. if i == len(x)-1:
  9. following = x[0]
  10. else:
  11. following = x[i+1]
  12. y[i] = previous + following
  13.  
  14. for i in range(0, len(x)):
  15. print(y[i])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement