Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = [int(i) for i in input().split()]
- y = 0
- c = 1
- b = []
- for a[y] in a:
- if y == 0:
- sum1 = a[y + 1] + a[-y]
- b.insert(0, sum1)
- elif y == len(a):
- sum2 = a[y - 1] + a[0]
- b.insert(-1, sum2)
- else:
- while y < len(a):
- sum = a[y - 1] + a[y + 1]
- b.insert(c, sum)
- с += 1
- y += 1
- print(b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement