I tried to solve the problem statement under code chef website … whose problem code is
SLICE1_PY
even after getting the expected output from the below code … on submission it says the answer is wrong
n = int(input()) #enter no. of test cases
for i in range(n):
len=int(input()) # enter length of list
input_string = input() # Enter numbers separated by spaces:
numbers = list(map(int, input_string.split()))
print(“Printing elements in reverse order :”)
for i in numbers[::-1]:
print(i,end=" ")
print()
print(“printing every 3rd element with 3 added to it:”)
for e in [x+3 for x in numbers[3::3]]:
print(e,end=" ")
print()
print(“printing every 5th element with 7 subtracted from it:”)
for e in [x-7 for x in numbers[5::5]]:
print(e,end=" ")
print()
print(“printing sum of elements from 3 to 7:”)
print(sum(numbers[3::]))
what should i do ??
i have to submit this problem till tonight