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
Elodia [21]
2 years ago
7

What is the next line?

Computers and Technology
1 answer:
Contact [7]2 years ago
5 0

The right answer is option 4: 2

Explanation:

Lists are used in Python to store elements of same or different data types.

Different functions are used in Python on List. One of them is count.

Count is used to count how many times a specific value occurs in a list.

The syntax for count is:

listname.count(value)

In the given code,

The output will be 2

Hence,

The right answer is option 4: 2

You might be interested in
Write a program that reads numbers from the user until a blank line is entered. Your
ddd [48]

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.

5 0
2 years ago
Create an application containing an array that stores eight integers. The application should call five methods that in turn (1)
Butoxors [25]

Answer:

package b4;

public class ArrayMethodDemo {

public static void main(String[] args) {

 // Create an array to store 8 random integers.

 int[] integernumbers = { 3, 4, 6, 9, 5, 6, 7, 2 };

 // Call the display method to show the elements in the array.

 display(integernumbers);

 // Call the method to display the elements in reverse order.

 displayReverse(integernumbers);

 // Call the method to find the sum of the elements.

 sum(integernumbers);

 // Call the method to display all elements less than a limiting value, say 5.

 lessThan(integernumbers, 5);

 // Call the method to display all elements greater than the average of the array

 // elements.

 higherThan(integernumbers);

}

// Method to display the elements in the array.

// The method receives only a single argument which is the array.

// Loop through the array and at every cycle, print out each element

public static void display(int[] arr) {

 System.out.print("All integers in the array : ");

 for (int i = 0; i < arr.length; i++) {

  System.out.print(arr[i] + " ");

 }

 System.out.println();

}

// Method to display the elements in the array in reverse order

// The method receives only a single parameter which is the array

// Loop through the array starting at the last index

// At every cycle, print out the elements in the array

public static void displayReverse(int[] arr) {

 System.out.print("All integers in the array in reverse : ");

 for (int i = arr.length - 1; i >= 0; i--) {

  System.out.print(arr[i] + " ");

 }

 System.out.println();

}

// Method to print out the sum of the elements in the array.

// The method receives only a single parameter which is the array.

// Declare a variable called sum to hold the sum of the elements

// Initialize sum to zero

// Loop through the array and cumulatively add each element to sum

// Print out the sum at the end of the loop

public static void sum(int[] arr) {

 int sum = 0;

 for (int i = 0; i < arr.length; i++) {

  sum += arr[i];

 }

 System.out.println("The sum of the integers in the array is " + sum);

}

// Method to print all values in the array that are less than a limiting

// argument.

// The method has two parameters - the array and the limiting argument.

// Loop through the array and at every cycle,

// check if the current array element is less than the limiting argument.

// If it is, print it out. Else continue

public static void lessThan(int[] arr, int limitingargument) {

 System.out.print("All values less than the limiting argument (" + limitingargument + ") are: ");

 for (int i = 0; i < arr.length; i++) {

  if (arr[i] < limitingargument) {

   System.out.print(arr[i] + " ");

  }

 }

 System.out.println();

}

// Method to print all values in the array that are higher than the average of

// the array.

// The method has one parameter - the array.

// First, calculate the average of the array elements.

// Loop through the array and at every cycle,

// check if the current array element is greater than the average.

// If it is, print it out. Else continue

public static void higherThan(int[] arr) {

 int sum = 0;

 for (int i = 0; i < arr.length; i++) {

  sum += arr[i];

 }

 double average = sum / arr.length;

 System.out.print("All values higher than the calculate average (" + average + ") is ");

 for (int i = 0; i < arr.length; i++) {

  if (arr[i] > average) {

   System.out.print(arr[i] + " ");

  }

 }

 System.out.println();

}

}

Explanation:

The program has been written in Java.

Please go through the comments in the code for explanation.

The source code has also been attached to this response.

Hope this helps!

Download java
3 0
3 years ago
The operating system is loaded into memory during the ____ process
Svet_ta [14]
Installation process

8 0
3 years ago
To make data goes to just appropriate device we use​
Stells [14]

Answer:

To make sure that data sent from a device is just received by appropriate device we use "<u>Switch</u>"  

Explanation:

Switch is the networking device. It is used to connect all the Local area networks in a computer network. The switch store the addresses of all computers over the network. Whenever data packet arrives to the switch, it just read the address of destination computer and just send it to appropriate device instead of all devices.

Hub is also used for this purpose, but it has no ability to read the address and send the packet to all devices over the network.

<em>So, we use Switch to send data to appropriate device.</em>

8 0
3 years ago
generally, ( mouse,keyboard,hard disk,pen drive) can't be removed from the computer ? choose the correct answer​
artcher [175]

Answer:

Hard Disk

Explanation:

A very important part of a computer is the hard disk. It stores data and documents that users may have downloaded. Removing the hard disk could make the computer useless.

A mouse, keyboard, or pen drive can be easily removed.

A mouse and a pen drive are USB-connected devices and can be removed by simply unplugging the cable. A keyboard can be removed by simply taking off the keycaps. It is easily accessible.

-Chetan K

7 0
2 years ago
Read 2 more answers
Other questions:
  • Corinne would like to click on the link at the bottom of a Web page but she only sees the top portion of the page. She should __
    6·2 answers
  • A user reports that she can't access the new server used in the accounting department. you check the problem and find out that h
    9·1 answer
  • What is DAP? How LDAP is different from DAP?
    10·1 answer
  • Who was eqvtime tayaishvili?​
    13·2 answers
  • A potential threat to administrators’ ability to manage the correctional system is
    12·1 answer
  • PLEASE HELP, True or False: The term whitespace speaks to the design of a website
    8·2 answers
  • Create a structure representing a student. The member variables should include student name, student ID, and four test grades fo
    12·1 answer
  • Why hackers hack?? in other people?​
    8·2 answers
  • Most portable devices, and some computer monitors have a special steel bracket security slot built into the case, which can be u
    13·1 answer
  • When you add encryption to a powerpoint presentation what does it do
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!