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]
3 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]3 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
Write a function in python that computes and returns the sum of the digits for any integer that is between 1 and 999, inclusive.
DanielleElmas [232]

Answer:

def sum_digits(number):

   total = 0

   if 1 <= number <= 999:

       while number > 0:

           r = int (number % 10)

           total +=r

           number /= 10

   else:

       return -1

   return total

   

print(sum_digits(658))

Explanation:

Write a function named sum_digits that takes one parameter, number

Check if the number is between 1 and 999. If it is, create a while loop that iterates until number is greater than 0. Get the last digit of the number using mudulo and add it to the total. Then, divide the number by 10 to move to the next digit. This process will continue until the number is equal to 0.

If the number is not in the given range, return -1, indicating invalid range.

Call the function and print the result

3 0
3 years ago
1. A truck leaves a stop sign and accelerates uniformly over a time of 5.21 seconds for a
Rufina [12.5K]

Answer:

1, is 21.11 meters per second.

110/5.21

Explanation:

3 0
3 years ago
Drag each tile to the correct box.
Arte-miy333 [17]

Answer:

Explanation:

web server= stores text, images, and other media that make up a website

email server= stores and exchanges messages

Proxy server= filters content and stores data for faster access

FTP server= stores and provides files for download

7 0
2 years ago
Read 2 more answers
In order for a computer to pass the ________, a human should have a conversation with it and not be able to tell if it was a mac
Katena32 [7]

The test that a computer needs to pass after a human's conversation with it and not be able to tell if it was a machine or a human is; Turing Test

<h3>Test of Computers</h3>

The correct answer to the blank portion of the question is Turing test. This is because Turing Test is a test of a computer's ability to exhibit intelligent behavior that is equivalent to, or indistinguishable from, that of a human's behavior.

Finally, If the evaluator cannot reliably tell the computer from the human, the machine is said to have passed the test.

Read more about Test of Computer at; brainly.com/question/21283135

8 0
2 years ago
Demographics and psychographics influence database marketing.<br><br><br> False<br><br> True
Kamila [148]

Answer:

true is the correct answer

5 0
3 years ago
Other questions:
  • Which protocol can be used to send ipv6 packets over an ipv4 network?
    5·1 answer
  • When working in the middle of a presentation, how do you preview the slide show from the current slide?
    12·1 answer
  • Answer the following questions: • What is the source of the user’s request? Can a technical solution solve his problem? Perhaps
    10·1 answer
  • A user has a network device that streams media to the LAN. The device is visible on the network. All PCs on the LAN can ping the
    13·1 answer
  • Write two examples of hard copy output?​
    9·1 answer
  • Coment on this if your user starts with dida
    5·1 answer
  • 9.18 LAB: Exact change - methods Write a program with total change amount as an integer input that outputs the change using the
    11·1 answer
  • Write a for loop with a range function that prints the following output. Name the target variable number. 0 1 2 3 4 5
    6·1 answer
  • Ashley works for a company that helps hospitals hire new doctors. They have written a list of strategies that can be used to int
    12·1 answer
  • When computer network are joined together they form a bigger network called the​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!