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
sergiy2304 [10]
2 years ago
15

Write a program that reads numbers from the user until a blank line is entered. Your

Computers and Technology
1 answer:
ddd [48]2 years ago
5 0

Answer:

nums = []

while True:

   in = input()

   if in:

       nums.append(in)

   else:

       break

if nums:

   avg = sum(nums) / len(nums)

   for i in range(len(nums)):

       if nums[i] == avg:

           print(f"index: {i+1}")

           print(nums[i])

else:

   print(-1)  # if there aren't any values in nums

Explanation:

Assuming that you are coding in Python 3x. The last 'else' statement is an edge case that you might want to consider, I don't know what you want to put there, but I'm just going to leave it as -1.

You might be interested in
Mohammed’s parents learn that his classmates have begun sending him text messages making fun of his heritage. Mohammed says he’s
pychu [463]

Answer:

Mohammed doesn't believe the cyberbullying exists.

Explanation:

If he knew he wouldn't say they are teasing him. I mean, how would their parents know he is being cyberbullied without evidence? Text messages(such as imessages) are most likely on phones, and not on computers.(Unless its an mac I believe.) And they are bullying him; its not using technology positively.

7 0
3 years ago
Read 2 more answers
It's best to use assertive speech when you<br> I want to show respect. *<br> True<br> False
mestny [16]

Answer:

True

Explanation:

Hope this helps :)

6 0
3 years ago
Read 2 more answers
Advantages of a computer​
Bess [88]

Answer:

It eases work.

It is deligent.

It is versatile.

8 0
3 years ago
What is the definition of overflow in binary?
asambeis [7]
Overflow occurs when the magnitude of a number exceeds the range allowed by the size of the bit field. The sum of two identically-signed numbers may very well exceed the range of the bit field of those two numbers, and so in this case overflow is a possibility.
4 0
3 years ago
Write a SELECT statement that returns one row for each customer that has orders with these columns:
d1i1m1o1n [39]

Answer:

SELECT email_address,

SUM(item_price * Quantity) AS item_price_total,

SUM(discount_amount * Quantity) AS discount_amount_total

FROM Customers c

JOIN Orders o ON c.CustomerID = o.CustomerID

JOIN Order_Items oi ON o.OrderID = oi.OrderID

GROUP BY email_address

ORDER BY item_price_total DESC

Explanation:

In this SQL statement the SELECT statement selects the following columns:

email_address

item_price

Quantity

discount_amount

There are two tables Customers and Order_Items

SUM aggregate function is used to add the values of the product of the columns discount_amount and Quantity. It is also used to get the sum of the product of two columns discount_amount and Quantity.

A new temporary column named item_price_total is used to name the sum of the product of two columns discount_amount and Quantity using AS which is ALIAS and it is used to give a name to some columns or a table.

Similarly discount_amount_total name is given to the column which calculate the sum of the product of two columns i.e. discount_amount and Quantity.

JOIN is used here to join the columns from the tables Order_items and Customers.

GROUP BY is used to group the result of rows and is used with functions like SUM. Here the rows are grouped by the email address.

ORDER BY is used to order the result. Here the result is ordered by item_price_total in descending  order.

This SELECT statement can also be written as following:

SELECT c.email_address,

SUM(o.item_price * o.Quantity),

SUM(o.discount_amount * o.quantity)

FROM customer c

JOIN Order_Items o ON o.id = c.id

GROUP BY c.email_address

7 0
3 years ago
Other questions:
  • What two terms below describe a network device with three ports, two of which send and receive all traffic, and the third port m
    6·1 answer
  • What's another name for the Super High shot, if you shot it on the ground using a tripod?
    14·1 answer
  • Anicius boethius invented a system that made possible the memorization and written transmission of melodies.
    9·1 answer
  • Select four programs that make up system software.Select four programs that make up system software.
    8·1 answer
  • The main disadvantage of using this device is its negative impact on network performance,resulting from the fact that any incomi
    10·1 answer
  • why are the ads you might see on tv between 8am and 10am usually not the same ads you would see between 8pm and 10pm?
    12·1 answer
  • If two egg cells are fertilized what will happen?
    10·1 answer
  • Question 1(Multiple Choice Worth 5 points)
    9·1 answer
  • 6. You and your friends take an awesome selfie, and you add your name and addresses to the picture. It is a good idea to share t
    11·1 answer
  • The computer scientists Richard Conway and David Gries once wrote: The absence of error messages during translation of a compute
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!