Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started