subject
Computers and Technology, 14.10.2020 01:01 arri05

Write a Python program stored in a file q1.py that : Gets a number as an input from the user and stores it in a variable. That number represents the length of a list. The program should then keep prompting until the user enters a valid number which is less than 10, and greater than 2. Creates a list where the user enters each entry in the list (explicitly convert each entry to type int). An entry is considered valid only if it is strictly greater than 0. If the entry is not valid, then the program should re-run from the invalid entry index, until valid entries are entered by the user. Gets a target number as an input from the user, and prints any two distinct list entries (values and indices) whose sum is equal to the target number. If no such entries are found then prints the sum of all the entries of the list.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:30
The cm is responsible for overseeing the actions of the crisis management team and coordinating all crisis management efforts in cooperation with disaster recovery and/or business continuity planning, on an as-needed basis
Answers: 1
question
Computers and Technology, 23.06.2019 12:20
When guido van rossum created python, he wanted to make a language that was more than other programming languages. a. code-based b. human-readable c. complex d. functional
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
A. in packet tracer, only the server-pt device can act as a server. desktop or laptop pcs cannot act as a server. based on your studies so far, explain the client-server model.
Answers: 2
question
Computers and Technology, 24.06.2019 10:10
Which view in a presentation program displays a split window showing the slide in the upper half and a blank space in the lower half?
Answers: 1
You know the right answer?
Write a Python program stored in a file q1.py that : Gets a number as an input from the user and sto...
Questions
question
Biology, 05.01.2021 19:00
question
Mathematics, 05.01.2021 19:00
question
Mathematics, 05.01.2021 19:00
Questions on the website: 13722361