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

Given a list of integers. find the size of the list

Computers and Technology
1 answer:
dlinn [17]2 years ago
6 0

The size of a list of integers can be found using python as follows;

size = len(list1)

<h3>How to find the size of a list using python?</h3>

The size of a list can be found using the len() function in python.

According to the question, the list is an integer.

Therefore, let's use an example below:

list1 = [1, 2, 1, 3, 6, 7, 8, 9, 4, 7, 8, 6, 4]

size = len(list1)

print(size)

Therefore,  the size of a list of integers can be found using the len() function in python.

learn more on python here: brainly.com/question/14989942

#SPJ1

You might be interested in
Fred wants to analyze his spending habits of the past few years and has gathered information on the checks he has written from 2
finlep [7]

Answer:

See explaination

Explanation:

import java.io.File;

import java.io.FileNotFoundException;

import java.util.Scanner;

public class SpendAnalysis {

// year 2014 data will be at index 0

// year 2015 data will be at index 1

// year 2016 data will be at index 2

// year 2017 data will be at index 3

// year 2018 data will be at index 4

private static int[] checkIssued={0,0,0,0,0}; // will store the count of check for the year

private static double[] totalAmount={0,0,0,0,0}; // will store the total amount spent for that year

private static final int BASE_YEAR=2014; // base year

// need to update the below line so that it points to the input text file need to be read

private static final String INPUT_FILE="D:\\spent.txt";

public static void main(String[] args) {

// first read all the data from the input file and populate the array

try {

populateData();

} catch (FileNotFoundException e) {

System.out.println(INPUT_FILE+" could not read. Program will terminate now.");

System.exit(1);

}

// second print the data in the console

reportSpending();

}

// read data from input file and update the two arrays

public static void populateData() throws FileNotFoundException {

Scanner fileInput = new Scanner(new File(INPUT_FILE));

while(fileInput.hasNext()){

String[] lineTokens = fileInput.nextLine().split("\\s+");

if(lineTokens.length==2){

int year = Integer.parseInt(lineTokens[0].trim());

double amount = Double.parseDouble(lineTokens[1].trim());

checkIssued[year-BASE_YEAR]+=1;

totalAmount[year-BASE_YEAR]+=amount;

}

}

}

// print the report in the console

public static void reportSpending(){

System.out.println(String.format("%-13s%-15s%-15s%-15s","Year","# Checks","Total Spent","Average Check"));

System.out.println(String.format("%-15d%-15d$%-15.2f$%-15.2f",2014,checkIssued[0],totalAmount[0],totalAmount[0]/checkIssued[0]));

System.out.println(String.format("%-15d%-15d$%-15.2f$%-15.2f",2015,checkIssued[1],totalAmount[1],totalAmount[1]/checkIssued[1]));

System.out.println(String.format("%-15d%-15d$%-15.2f$%-15.2f",2016,checkIssued[2],totalAmount[2],totalAmount[2]/checkIssued[2]));

System.out.println(String.format("%-15d%-15d$%-15.2f$%-15.2f",2017,checkIssued[3],totalAmount[3],totalAmount[3]/checkIssued[3]));

System.out.println(String.format("%-15d%-15d$%-15.2f$%-15.2f",2018,checkIssued[4],totalAmount[4],totalAmount[4]/checkIssued[4]));

int totalChecks = checkIssued[0]+checkIssued[1]+checkIssued[2]+checkIssued[3]+checkIssued[4];

double totalSpent = totalAmount[0]+totalAmount[1]+totalAmount[2]+totalAmount[3]+totalAmount[4];

System.out.println(String.format("%-15s%-15d$%-15.2f$%-15.2f","Overall Total",totalChecks,totalSpent,totalSpent/totalChecks));

}

}

4 0
3 years ago
Why are formulas used in spreadsheets?
cluponka [151]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is B.

The formulas in the spreadsheet are used to do the automatic calculation when data is changed in the spreadsheet.

For example, if you add numbers in a column and then get average. you can use sum() and average() formula to calculate the sum and average of numbers in a column. If you will change any number in the column, the calculation for sum and average automatically done. So, the answer to this question is B. i.e.

so that calculations are automatically redone when data is changed.

While the other options are not correct because:

  • To ensure data is entered correctly is done by validation not by using formula.
  • To ensure data is properly formated is done in the formatting section.
  • The error can be easily identified using validation features in excel.

7 0
3 years ago
The three main objectives of information security are.
kotykmax [81]

Answer:

confidentiality, integrity, availability

Explanation:

Confidentiality: Data and information assets must be confined to people who have authorized access and not disclosed to others

Integrity: Keeping the data intact, complete and accurate, and IT systems operational

Availability: An objective indicating that information or system is at disposal of authorized users when needed.

8 0
2 years ago
HELP ME ILL GIVE BRAINLY Input 50 numbers and then output the average of the negative numbers only. Write in pseudocode!
Mumz [18]

Answer:

The explanation is for 10 inputs though. You'd have to follow these steps to find input 50 numbers.

Explanation:

This is how I wrote it in the Plain English programming language which looks like pseudo-code but compiles and runs (to save you all the rest of the steps):

To run:

Start up.

Write "Enter 10 numbers separated by spaces: " on the console.

Read a reply from the console.

Loop.

If the reply is blank, break.

Get a number from the reply.

Add 1 to a count.

Add the number to a total.

Repeat.

Write "The total is: " then the total on the console.

Put the total divided by the count into an average.

Write "The average is: " then the average on the console.

Refresh the screen.

Wait for the escape key.

Shut down.

3 0
3 years ago
Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output tho
katen-ka-za [31]

Answer:

import java.util.Scanner;

public class BasicInput {

   public static void main(String[] args) {

       //Create an object of the Scanner class

       Scanner scnr = new Scanner(System.in);

       

       //Define int and double variables

       int userInt;

       double userDouble;

       

       //Define char and string variables similarly

       char userChar;

       String userString;

       

       //Prompt the user to enter an integer

      System.out.println("Enter integer:");

       //Store the input in the integer variable

       userInt = scnr.nextInt();

       

       //Prompt the user to enter a double

        System.out.println("Enter double:");

       //Store the input in the double variable

      userDouble = scnr.nextDouble();

       

       //Prompt the user to enter a char

        System.out.println("Enter char:");

       //Store the input in the char variable

      userChar = scnr.next().charAt(0);

       

       //Prompt the user to enter a string

        System.out.println("Enter String:");

       //Store the input in the string variable

      userString = scnr.next();

       

       //Output the four values on a single line

       //separated by a space

       System.out.println(userInt + " " + userDouble + " " + userChar + " " + userString);

       

   }

   

}

Sample Output:

Enter integer:

>>12

Enter double:

>>23

Enter char:

>>s

Enter String:

>>asdasd

12 23.0 s asdasd

Explanation:

The code above has been written in Java. It contains comments explaining every part of the code. Please go through the comments.

5 0
3 years ago
Other questions:
  • A name given to a spot in memory is called:
    5·1 answer
  • Which group on the sparkline tools design tab would you choose if you wanted to change the data source of the sparkline? (1 poin
    10·1 answer
  • What are the principal cybersecurity threats, both internal and external, and the principal safeguards that have been developed
    13·1 answer
  • What is the main feature of chat rooms?
    9·2 answers
  • Illusions in physcology​
    14·1 answer
  • What is the best motivation that you can do/give to make your employees stay? ​
    6·1 answer
  • Write the definition of a function that evaluates three double numbers and returns true if the floor of the product of the first
    8·1 answer
  • A specialized output device for producing charts, maps, and very high-quality drawings is
    5·1 answer
  • If a company saw an online photo of you playing basketball, it might try to sell
    5·1 answer
  • One of the most notable impacts of IT on business is improved
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!