1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
andre [41]
4 years ago
14

Write a program that reads a list of integers into a list as long as the integers are greater than zero, then outputs the smalle

st and largest integers in the list. Ex: If the input is: 10 5 3 21 2 -6 the output is: 2 21 You can assume that the list of integers will have at least 2 values.

Computers and Technology
2 answers:
GarryVolchara [31]4 years ago
4 0

Answer:

I am writing a Python program.

integers = []

while True:

       number = int(input("Enter integers (Enter negative number to end) "))

       if number < 0:

          break

       integers.append(number)  

print ("The smallest integer in the list is : ", min(integers))

print("The largest integer in the list is : ", max(integers))

Explanation:

integers[] is the list which contains the numbers entered by the user.

while loop continues to execute until the user enters a negative value.

input() function reads the input entered by the user and int(input()) accepts and reads the int (integer) type inputs entered by the user. number holds each input entered by the user and checks if that integer is less than 0 means user enters a negative value. If it is true then the loop breaks and if it is false then the every value stored in the number is added to the list integers.

append() method adds the elements into the list.

When the user enters a negative value, the while loop breaks and the program control moves to last two print statements.

The first print() statement uses min() function which computes the minimum value in the list integers.

The second print() statement uses max() function which computes the maximum value in the given list integers.

The screen shot of program along with its output is attached.

Natali5045456 [20]4 years ago
3 0

Answer:

lis=[]

lis=input("Enter a list of integers:")

i=0

for i in range(0, len(lis)):

  j=int(lis[i])

  if j%2==0:

      print(j, "is even")

  else:

      print(j, "is odd")

Explanation:

You might be interested in
An EULA usually takes the form of an electronic notification that appears when installing software. The user then has a choice t
irga5000 [103]

Answer:

True

Explanation:

An end user license agreement (EULA) is usually designed by a software developer to take the form of an electronic notification that would appear on the screen of the device of an end user when he or she is installing a software.

Furthermore, an end user has a choice to accept or decline the terms of this agreement.

8 0
4 years ago
When a number gets assigned to a variable that already has a value __________. the new number overwrites the previous value at t
sammy [17]

Answer: the new number overwrites the previous value at that memory location

Explanation:

8 0
3 years ago
If we are using an 4-character password that contains only lowercase English alphabetic characters (26 different characters), ho
Trava [24]

Answer:

11,424,400 possible passwords

Explanation:

Since all characters are letters and only lowercase

we have 26∧4 = 456,976 possibilities

For a 5-character password which is still lower case sensitive.

we have 26∧5 = 11,881,376 possibilities

Many more possible passwords = (11881376-456976)

= 11,424,400 possible passwords

6 0
3 years ago
Read 2 more answers
A _____________ is used to make a deep copy of an object.
lesya [120]
The answer is a 3D Printer
3 0
4 years ago
Deciding whether to explode a process further or determine that it is a functional primitive is a matter of experience, judgment
pickupchik [31]

Answer:

The answer is "True".

Explanation:

The conceptual, abstract design is also known as a logical design. This design doesn't use to discuss in matter of the actual execution. It only has to identify the kinds of information.  

  • In the logical development process, it involves inserting information into a number, which includes the organizations and features of rational networks.
  • It is used to organize the entities, for example, tables for a relation database, in a given market environment into the database systems, that's why the given statement is true.
3 0
3 years ago
Other questions:
  • A ________ is a small text file passed to a web browser on a user's computer by a web server.
    7·1 answer
  • How to write equal to or greater than in word?
    9·1 answer
  • In the INSERT statement that follows, assume that all of the table and column names are spelled correctly, that none of the colu
    9·1 answer
  • Write a main function to do the following: A. Declare an array of 20 strings. B. Create an input file for the file "poem.dat". C
    12·1 answer
  • What would happen if you did not have a hard drive Installed on a computer? unable to use a keyboard no graphics no issues no pe
    8·2 answers
  • Identify a true statement of a JavaScript program in a web form.
    10·1 answer
  • They are correct? thank you!
    5·1 answer
  • Which of the following is not a form of technology?
    15·2 answers
  • Please give answer before explanation
    10·2 answers
  • Amber is a hacker who steals information when people enter their personal details on specific websites. She intercepts the publi
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!