Computers and Technology
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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 11:00, abdulbasharee99
In the context of the box model, what is the difference between a margin and a padding? a. a padding lies outside a box border, while a margin lies inside it. b. a padding lies inside a box border, while a margin lies outside it. c. a padding can be adjusted independently, while a margin depends on the size of its box. d. a padding depends on the size of its box, while a margin can be adjusted independently.
Answers: 3
image
Computers and Technology, 24.06.2019 14:00, maddi0132
In the microsoft® access® and microsoft excel® programs, the ribbon contains tabs that are divided into with like tools in them. parts groups containers bunches
Answers: 1
image
Computers and Technology, 24.06.2019 19:20, boyancecristina
Which command suppresses the visibility of a particular row or column in a worksheet?
Answers: 1
image
Computers and Technology, 25.06.2019 08:10, nyameneak
Which of the following is an example of an input device? a barcode readeran organic light-emitting diodean inkjet printera cathode ray tube
Answers: 1
Do you know the correct answer?
Write a Python program stored in a file q1.py that : Gets a number as an input from the user and sto...

Questions in other subjects:

Konu
Chemistry, 28.04.2021 15:40
Konu
Mathematics, 28.04.2021 15:40
Konu
Biology, 28.04.2021 15:50