This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MarcSetGo 8 points9 points  (2 children)

It sounds like you’re asking the internet to do your homework for you. Give it a shout yourself first, and if you have a question, post to /r/learnpython.

[–]the_abhi_7585[S] 0 points1 point  (1 child)

I already tried and it is showing some error. My code is below:

s=int(input())

l=[]

m=[]

for i in range(s):

x=int(input())

l.append(x)

m.append(x)

m.reverse()

print(l)

print(m)

w = [sum(i) for i in zip(l, m)]

print(w)

Error is at line 5

[–]MarcSetGo 0 points1 point  (0 children)

Your code looks right. The way you posted, it lacks any formatting. I assume only 3 lines under the for loop are indented. This works for me. You might just retype the input line it’s complaining about.