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
AnnyKZ [126]
3 years ago
6

Review how to write a for loop by choosing the output of this short program.

Computers and Technology
2 answers:
Alekssandra [29.7K]3 years ago
8 0

Answer:

The answer is 0 2 4. I hope this helps you out. Have a wonderful day and stay safe.

Explanation:

Natalija [7]3 years ago
5 0

This for loop will output:

0

2

4

The range(3) is all the integers between 0 inclusive and 3 exclusive. 0, 1, 2.

Every iterations through the for loop, we multiply the value of each number by 2 and print it to the console.

0 * 2 = 0

1 * 2 = 2

2 * 2 = 4

I hope this helps.

You might be interested in
An electronic resume is a plain-looking document. True of False?
Contact [7]
I think it's TRUE!!!!!!!!!!
8 0
3 years ago
Read 2 more answers
The word Only is absolute or qualified
Semenov [28]

The word "only" is absolute.

5 0
3 years ago
Read 2 more answers
(1) Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a
Sergeu [11.5K]

Answer:

import java.util.Scanner;

public class num3 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter Favorite color");

       String word1 = in.next();

       System.out.println("Enter Pet's name");

       String word2 = in.next();

       System.out.println("Enter a number");

       int num = in.nextInt();

       //Point One

       System.out.println("You entered: "+word1+" "+word2+

               " "+num);

       //Point Two

       String passwordOne = word1+"_"+word2;

       String passwordTwo = num+word1+num;

       System.out.println("First password: "+passwordOne);

       System.out.println("Second password: "+passwordTwo);

       //Point Three

       int len_passwrdOne = passwordOne.length();

       int len_passwrdTwo = passwordTwo.length();

       System.out.println("Number of characters in "+passwordOne+" :" +

               " "+len_passwrdOne);

       System.out.println("Number of characters in "+passwordTwo+" :" +

               " "+len_passwrdTwo);

   }

}

Explanation:

  • This question is solved using java programming language
  • The scanner class is used to receive the three variables (Two string and one integer)
  • Once the values have been received and stored in the respective variables (word1, word2 and num), Use different string concatenation to get the desired output as required by the question.
  • String concatenation in Java is acheived with the plus (+) operator.
3 0
3 years ago
Write a function maxTemp which takes a filename as string argument and returns the maximum temperature as float type for the wee
Alenkinab [10]

Answer:

#section 1

def maxTemp(filename):

   import pathlib

   f = pathlib.Path(filename)

   f.exists()

   if f.exists():

       f = open(filename, "r")

#section 2

       next(f)

       res = [int(sub.split(',')[1]) for sub in f]

       maxdata = (res[0])

       for i in range(len(res)-1):

           if maxdata < res[i]:

               maxdata = res[i]

       

       index = res.index(maxdata)

       f.close()

 #section 3  

       li = []  

       a = open(filename, "r")

       for line in a:

           line = line.strip()

           li.append(line)

   

       

       a.close()

       return (li[index+1])

   else:

       return -1

print(maxTemp("new.csv"))

Explanation:

#section 1:

The function maxTemp is defined. We import pathlib in other to check if the file exists, if it does we carry on with opening the file and if it doesn't the program returns -1.

#section 2:

We start splitting the sub-lists from the second line i.e <em>next(f)</em>. For each line we take the second index element and convert it to an integer.

<em>res = [int(sub.split(',')[1]) for sub in f] </em>

The maximum number is gotten by using the if statement to compare all elements in the list.  The index of the maximum item in the list is collected.

the file is then closed.

#section 3  :

The file is re-opened and all the lines are striped and passed into a new list and the index recovered from section 2, is used to get the day with the highest temperature and the line is returned.

8 0
3 years ago
Discussion Topic
frozen [14]

The advantages of using spreadsheets for managing personal finances is that:

  • Spreadsheets are known to be tools that are very quick and easy and helps one to add into a workflow.
  • Spreadsheets are regarded as an efficient tools for financial documents. A person can have access to a lot of spreadsheet templates and they can be able to visualize data along with caveats.

<h3>What is the advantage of using a spreadsheet?</h3>

The Advantage is that it is one that help[s a person to be able to organizing a lot of data.

Note that The advantages of using spreadsheets for managing personal finances is that:

  • Spreadsheets are known to be tools that are very quick and easy and helps one to add into a workflow.
  • Spreadsheets are regarded as an efficient tools for financial documents. A person can have access to a lot of spreadsheet templates and they can be able to visualize data along with caveats.

Learn more about spreadsheets  from

brainly.com/question/26919847

#SPJ1

6 0
1 year ago
Other questions:
  • Chris needs to modify the default bullets that are used in a nonnumbered list in word. Which method should he use?
    9·2 answers
  • NEED HELP FAST
    13·2 answers
  • Engineers and scientists redesign a prototype if it does not work correctly true or false and why
    10·2 answers
  • In the Programming Process which of the following is not involved in defining what the program is to do:_____________ Group of a
    10·1 answer
  • What do you need for digital photography? 1. 2. 3.
    13·1 answer
  • Write a program that prompts the user to enter a number then counts the number of odd numbers and even numbers the user enter. T
    15·1 answer
  • If a file you are opening for appending does not exist, the operating system will detect the missing file and terminate the oper
    14·1 answer
  • Which file is usually the first file to be displayed when you navigate to a website?
    5·1 answer
  • How long does an online snap application take to process ohio
    6·1 answer
  • What is the launching of a 3-D map called?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!