Python Forum
EOFError: EOF when reading a line - Runtime Error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
EOFError: EOF when reading a line - Runtime Error
#7
Objective
Today, we're learning about the Array data structure. Check out the Tutorial tab for learning materials and an instructional video!

Task
Given an array,A , of N integers, print A 's elements in reverse order as a single line of space-separated numbers.

Input Format


The first line contains an integer,N (the size of our array).
The second line contains N space-separated integers describing array A's elements.

Constraints
1 <= N <= 1000

1<= Ai<=10000, where Ai is the ith integer in the array.
Output Format

Print the elements of array Ain reverse order as a single line of space-separated numbers.
Sample Input

4
1 4 3 2
Sample Output

2 3 4 1
I think this solution for this challenge, because I know only for and if conditions in Python and I see in documentation that there is a method call reverse () , but if there is another way I will accept and forgive me If I was wrong.
Reply


Messages In This Thread
RE: EOFError: EOF when reading a line - Runtime Error - by RavCOder - Sep-27-2019, 12:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  class and runtime akbarza 4 576 Mar-16-2024, 01:32 PM
Last Post: deanhystad
  Reading and storing a line of output from pexpect child eagerissac 1 4,577 Feb-20-2024, 05:51 AM
Last Post: ayoshittu
  Reading in of line not working? garynewport 2 1,092 Sep-19-2023, 02:22 PM
Last Post: snippsat
  xlwings error when reading a workbook Mishal0488 1 1,311 Aug-01-2023, 02:05 AM
Last Post: deanhystad
  File "<string>", line 19, in <module> error is related to what? Frankduc 9 13,022 Mar-09-2023, 07:22 AM
Last Post: LocklearSusan
  painfully slow runtime when handling data dadazhu 3 1,146 Jan-20-2023, 07:11 PM
Last Post: snippsat
  Big O runtime nested for loop and append yarinsh 4 1,583 Dec-31-2022, 11:50 PM
Last Post: stevendaprano
  Pandas - error when running Pycharm, but works on cmd line zxcv101 1 1,487 Jun-18-2022, 01:09 PM
Last Post: snippsat
  I have an issue with Netmiko Error reading SSH protocol banner omarhegazy 2 3,790 May-16-2022, 06:05 PM
Last Post: omarhegazy
  Reducing runtime memory usage in Cpython interpreter david_the_graower 2 2,379 Oct-18-2021, 09:56 PM
Last Post: david_the_graower

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020