Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem Description: You are asked to write a Python script that prompts the user to enter the number of items that should be displayed from

Problem Description: You are asked to write a Python script that prompts the user to enter the number of items that should be displayed from a list.

Concept(s) to Apply:

1. forin

2. range()

3. int()

4. input()

5. Variables

6. print()

Approximate Number of Lines in Solution: 5

Pseudocode

Declare a variable named numbers and set it to a list that contains the following ten numbers:

1

-2.5

777

777.77

-88

-88

1234

-1234

1.2345

-9.8765

Prompt the user to enter a numerical value without fractions or decimals for variable count with the following message: "Enter an integer number between 1 and 10: "

Change the data type of count to be an integer data type by using explicit type conversion.

Create a for loop that goes through the indices of numbers, but only up to the value of count, where variable current_index is used to represent the current index within the for loop and does the following:

Display the current number, by way of list indexing, in the console/output screen.

Pseudocode Notes

Remember that the list of indices for numbers should start at 0 and end at count 1.

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 Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

List the common parties of a trust.

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago