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
Technology
Mashcka [7]

Answer

✔ user interface

✔ rendering engine

✔ browser engine

✔ Networking

✔ Data storage

:)

4 0
2 years ago
57. Tammy's income for the month of January was $2,475. Her fixed expenses during that same
Roman55 [17]

Answer:

57. Tammy's income for the month of January was $2,475. Her fixed expenses during that same

month were $750, and her variable expenses totaled $1,750. What was Tammy's net cash flow

during the month of January? Be sure to indicate whether she had a surplus or a deficit.

Explanation:

no clue

5 0
3 years ago
Create an ArrayList of strings to store the names of celebrities and athletes. Add 5 names to the list. Process the list with a
mr Goodwill [35]

Answer:

// ArrayList class is imported

import java.util.ArrayList;

// Iterator class is imported

import java.util.Iterator;

// Main class is defined

class Main {

   // main method to begin program execution

   public static void main(String args[]) {

       // names ArrayList of String is defined

       ArrayList<String> names = new ArrayList<>();

       // 5 names are added to the list

       names.add("John");

       names.add("Jonny");

       names.add("James");

       names.add("Joe");

       names.add("Jolly");

       // for loop to print the names inside the arraylist

       for(int index = 0; index <names.size(); index++){

         System.out.println(names.get(index));

       }

       

       // A blank line is printed

       System.out.println();

       // A newMethod is called with names as argument

       newMethod(names);

       // A blank line is printed

       System.out.println();

       // Instance of Iterator class is created on names

       Iterator<String> iter

           = names.iterator();

 

       // Displaying the names after iterating

       // through the list

       while (iter.hasNext()) {

           System.out.println(iter.next());

       }

   }

   // the newmethod is created here

   public static void newMethod(ArrayList<String> inputArray){

     // A new name is added at index 2

     inputArray.add(2, "Smith");

     // the name in index 4 is removed

     inputArray.remove(4);

     // for each is used to loop the list and print

     for (String name : inputArray) {

       System.out.println(name);

       }

   }

}

Explanation:

The code is well commented. An output image is attached.

7 0
4 years ago
The general who directed the project responsible for the "Fat Man” graduated from what alma mater in 1918?
krek1111 [17]
Stafford Leak Warren (July 19, 1896 - July 26, 1981) was an American physician and ... He was responsible<span> for the health and safety of the thousands of personnel ... The medical school had opened in 1925 and did not </span>graduate<span> its first class ... Brigadier</span>General<span> Leslie R. Groves, the director of the Manhattan </span>Project<span> </span>
7 0
4 years ago
Read 2 more answers
Consider the following code:
Semmy [17]

Answer:

5

Explanation:

4 0
3 years ago
Other questions:
  • According to the partnership for 21st-century learning critical thinking ability includes all the following skills except
    15·1 answer
  • To easily add an organizational chart to a document, users should select _____. SmartArt Text Boxes Shapes Clip Art
    8·2 answers
  • If everyone's choice for their computer printer were an hp laserjet 4100, there would be a ___ preference segment in the compute
    8·1 answer
  • What Are Some Tips To Pass (Cisco ADVDESIGN) 352-001 Exam?
    12·1 answer
  • Complete the crossword puzzle.
    12·2 answers
  • A working model of a new product for testing purposes.
    15·1 answer
  • Can someone help me with these questions it's for drivers ed
    10·1 answer
  • Crees que el uso del internet ha mejorado nuestra vida o somos esclavos de ella​
    10·2 answers
  • Select the correct answer
    15·1 answer
  • When a browser is open on your computer, what browser tool is used to move the webpage to the previously viewed page on the brow
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!