Sep-27-2019, 09:46 AM
Hi,
The task of challenge is this:
Given an array, A, of N integers, print A's elements in reverse order as a single line of space-separated numbers.
Regards,
RavCoder
#!/bin/python3 import math import os import random import re import sys def print_reverse_number(n,arr): arr = [] n = int(input()) for i in range(0,n): element_input = int(input()) arr.append(element_input) arr.reverse() print(arr) if __name__ == '__main__': n = int(input()) arr = list(map(int, input().rstrip().split())) print_reverse_number(n, arr)
Error:Runtime Error
Error (stderr)
Traceback (most recent call last):
File "Solution.py", line 37, in <module>
print_reverse_number(n, arr)
File "Solution.py", line 11, in print_reverse_number
n = int(input())
EOFError: EOF when reading a line
I don't understand where is the problem with this code. The task of challenge is this:
Given an array, A, of N integers, print A's elements in reverse order as a single line of space-separated numbers.
Regards,
RavCoder