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
In one sentences describe how to change your home page
3241004551 [841]

Click Tools, Internet options. ...The Internet Options window will open. ...Click Apply, OK to close the window.Click the wrench icon in the top-right corner of the browser.Select Options.In the 'On startup' section, select Open the home page.options window will open. Go to the Startup section and select When Firefox starts: Show my home page.. In the Home Page field, type in the website address you want to use as your home page.Click OK.


4 0
2 years ago
• In your response, please include some examples of the three different types of storage.
babunello [35]
Hard Disk Drive
Solid State Drive
And Random Access Memory (RAM)
6 0
3 years ago
Read 2 more answers
Create a new data frame, first_south, by subsetting titanic to include instances where a passenger is in the first class cabin (
Virty [35]

The data frame first_south is created using first_south = (titanic['Pclass']==1) & (titanic['Embarked']=='S')

<h3>How to create the data frame?</h3>

To do this, we make the following assumptions:

  • The pandas module has been loaded as pd
  • The dataset has also been loaded as titanic

When pclass column is 1.

This is represented as:

titanic['pclass']==1

When the passenger boards from Southampton.

This is represented as:

titanic['Embarked']=='S'

So, we have:

first_south = (titanic['Pclass']==1) & (titanic['Embarked']=='S')

Read more about data frames at:

brainly.com/question/16524297

#SPJ1

4 0
1 year ago
What does a file extension tell you?
kiruha [24]

A. because everyone basically has seen it..

3 0
3 years ago
Jane sold many notebooks at her school fair and earned a good amount of cash. To keep a record, she entered all the cash values
pantera1 [17]
Use tab key & shift+$
6 0
3 years ago
Other questions:
  • Your company is developing a new marketing campaign and wants to know which customers have never placed an order. You will need
    10·1 answer
  • Another important mode, XTS-AES, has been standardized by the __________ Security in Storage Working Group. a. IEEE b. ITIL c. N
    9·2 answers
  • Where can you check effective access on a shared folder? answer?
    11·1 answer
  • Assume that scotus is a two-dimensional character array that stores the family names (last names ) of the nine justices on the S
    6·1 answer
  • A friend was just promoted to a new job that requires part-time travel, and he has also been promised a new laptop after his fir
    10·1 answer
  • Create a database with information about products in a catalog. As you plan, keep in mind that later you will want to sort this
    10·2 answers
  • Which line of code will find the first occurrence of a three in an array?
    5·2 answers
  • C++ Write a program that initially asks a user to enter two positive integer numbers a and b. If either a or are zero or negativ
    9·2 answers
  • Solve this for brainlest​
    10·1 answer
  • * what is an electronic mail ?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!