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
netineya [11]
3 years ago
12

Given a sorted list of integers, output the middle integer. A negative number indicates the end of the input (the negative numbe

r is not a part of the sorted list). Assume the number of integers is always odd. Ex: If the input is:
Computers and Technology
1 answer:
masya89 [10]3 years ago
8 0

Answer:

The program in Python is as follows:

myList = []

num = int(input())

count = 0

while num>=0:

   myList.append(num)

   count+=1

   num = int(input())

myList.sort()

mid = int((count-1)/2)

print(myList[mid])

Explanation:

This initializes the list

myList = []

This gets the first input

num = int(input())

This initializes count to 0

count = 0

The following is repeated until the user inputs a negative number

while num>=0:

This appends the input number to the list

   myList.append(num)

This increments count by 1

   count+=1

This gets another input

   num = int(input())

This sorts the list

myList.sort()

Assume the number of inputs is odd, the middle element is calculated as

mid = int((count-1)/2)

This prints the middle element

print(myList[mid])

<em>From the complete question. the condition that ends the loop is a negative integer input</em>

You might be interested in
What is the primary cause of the industrial revolution?
Whitepunk [10]

Explanation:

heyy

everyone come here for truth and dare

vzg-hqvy-wdn

5 0
3 years ago
8) Which of the following statements is FALSE?
user100 [1]

Answer:

3) Academic journal articles are always unbiased in their analysis.

Explanation:

The Academic journals are not always unbiased. There can be some authors which may write in some situation and bias the articles. It is important to analyse source and reliability of the article before relying on it. An unbiased author will try to capture picture fairly. The unbiased author presents the facts as it is and does not manipulates the truth.

4 0
3 years ago
Which are the best examples of cost that should be considered when creating a project budget
sashaice [31]

Explanation:

how much the project will cost

5 0
3 years ago
Uses of prototype and who made the prototype<br>​
myrzilka [38]

Answer:

A prototype is an early sample, model, or release of a product built to test a concept or process. It is a term used in a variety of contexts, including semantics, design, electronics, and software programming. A prototype is generally used to evaluate a new design to enhance precision by system analysts and users.

Explanation: The place that made prototype was Radical Entertainment.

Hoped this helped.

3 0
3 years ago
Observe the things at Home in which you are using binary
vazorg [7]

Explanation:

All five things i can come up with her

1. Doors (we either open or close them)

2. Tap (we either open or close the valve)

3.  Electric stove/cooker

4. The lid of containers

5. Shoes/ foot wears(we put them ON or OFF)

7 0
3 years ago
Other questions:
  • The first character of the VIN designates which of the following? 
    15·2 answers
  • How could a system be designed to allow a choice of operating systems from which to boot? What would the bootstrap program need
    14·1 answer
  • Mary is entering her senior year of college. She has a meeting on Friday with her advisor to discuss her career plans.Mary is al
    15·1 answer
  • . Database connectivity software is also known as:
    11·1 answer
  • How to get the home button on your screen?
    13·1 answer
  • Joann wants to insert page numbers at the bottom of the pages of her document using the Field option in Quick
    12·2 answers
  • What is used to connect computers to the internet*Audio Ports
    15·2 answers
  • PLEASE HELP <br> Which of the following best describes the existence of undecidable problems?
    7·1 answer
  • Write a function that accepts a positive random number as a parameter and returns the sum of the random number's digits. Write a
    10·1 answer
  • If I use the command right(90), which way will Tracy turn?<br> If correct I mark brainlist
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!