Python program that reverses the order of five numbers stored in a list. The program should first print the five numbers stored in the list. Next, the program passes the list to a function where the numbers are reversed. Finally, the main program should print the reversed numbers. Make sure the file Reverse.py is selected and open. Write the Python statements as indicated by the comments. Execute the program by clicking the Run button at the bottom of the screen code: """ Reverse.py - This program reverses numbers stored in an array. Input: Interactive. Output: Original contents of array and the reversed contents of the array. """ # Write reverseArray function here. numbers = [9, 8, 7, 6, 5] # Print contents of array. # Call reverseArray function here. # Print contents of reversed array.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

Python program that reverses the order of five numbers stored in a list.

The program should first print the five numbers stored in the list. Next, the program passes the list to a function where the numbers are reversed. Finally, the main program should print the reversed numbers.

  1. Make sure the file Reverse.py is selected and open.
  2. Write the Python statements as indicated by the comments.
  3. Execute the program by clicking the Run button at the bottom of the screen

code:

"""
Reverse.py - This program reverses numbers stored in an array.
Input: Interactive.
Output: Original contents of array and the reversed contents of the array.
"""


# Write reverseArray function here.


numbers = [9, 8, 7, 6, 5]

# Print contents of array.

# Call reverseArray function here.

# Print contents of reversed array.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT