Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that fetches the first count amount of elements of a list. (Python) Webull - Commons Free Stock Cading online porn Working with

Write a program that fetches the first count amount of elements of a list. (Python) image text in transcribed
image text in transcribed
Webull - Commons Free Stock Cading online porn Working with Lists Scenario 93 Write a program that fetches the first count amount of elements of a list. Aim Create a script that contains the array [34, 9, 32, 91, 58, 13, 77, 21, 56). The script will take a user input count that defines the number of elements to fetch from an array and then outputs those elements. Steps for Completion 1. Go to your main.py file. 2. On the first line, create the following array: nunbers = [34, 9, 32, 91, 58, 13, 77, 21, 56] 3. Next, print the array nunbers and fetch the user input count for the number of elements to fetch from the array 4. Finally, print out the slice of the array from the first element to the nth element. 5. Then, run the script by using the python3 main.py command The output should look like Figure 2.12 shown below. > Terminal 3 workspace s python Ratn.my Numbers 134, 9, 32, 91. se. 13, 77, 21, 561 Number of elements to fetch fron array: 4 134.912 911 4. Finally, print out the slice of the array from the first element to the nth element 5. Then, run the script by using the python3 main.py command The output should look like Figure 2.12 shown below: >- Terminal + workspace $ python3 nain.py Numbers: [34, 9, 32, 91, 58, 13, 77, 21, 56) Number of clenents to fetch fron array: 4 [34, 9, 32, 91] workspace $ python3 main.py Numbers: [34, 9, 32, 91, 58, 13, 77, 21, 56) Number of elenents to fetch fron array: 9 [34, 9, 32, 91, 58, 13, 77, 21, 56) workspace $ python3 nain.py Numbers: [34, 9, 32, 91, 58, 13, 77, 21, 56) Number of clenents to fetch fron array: 1 [34] workspace $ Figure 2.12 Grading Complete each task listed below. Each task contains automated checks which are used to calculate your grade. When you have completed each task by clicking the checkbox, open the task list panel on the left navigation bar and click the "Submit button. Task Follow the instructions and write a program that fetches the first count amount of elements of a list

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions