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
Verizon [17]
2 years ago
8

Add the beginning comments at the top of the program.

Computers and Technology
1 answer:
Arada [10]2 years ago
4 0

Answer:

#################

# Python Practice

#################

# Part 1

# ------------------------------------------------------

run_compare = 3

ran_compare = 0

while run_compare != ran_compare:

   num1 = int(input('Please input the first number: '))

   num2 = int(input('Please input the second number: '))

   def compare(number1, number2):

       if number1 < number2:

           print(f'{num1} is less than {num2}')

       elif number1 > number2:

           print(f'{num1} is greater to {num2}')

       else:

           print(f'{num1} is equal than {num2}')

   compare(num1, num2)

   ran_compare += 1

# ------------------------------------------------------

# Part 2

run_name = 6

ran_name = 0

names = []

# ------------------------------------------------------

while run_name != ran_name:

   name = input(str('Please insert a name: '))

   names.append(name)

   print(names)

   ran_name += 1

# ------------------------------------------------------

give me a second im going to resolve the last part but this is what i have so far

You might be interested in
The ArrayList class contains a trim method that resizes the internal array to exactly the capacity. The trim method is intended
andreev551 [17]

Answer:

public void trimToSize() {

modCount++;

if (size < elementData.length) {

elementData = (size == 0)

? EMPTY_ELEMENTDATA

: Arrays.copyOf(elementData, size);

}

}

Now, the running time for copyOf() function is O(N) where N is the size/capacity of the ArrayList. Hence, the time complexity of trimToSize() function is O(N).

Hence, the running time of building an N-item ArrayList is O(N^2).

Please find the sample code below.

CODE

==================

import java.util.ArrayList;

public class Driver {

  public static void main(String[] args) throws Exception{

      int N = 100000;

      ArrayList<Integer> arr = new ArrayList<>(N);

     

      long startTime = System.currentTimeMillis();

      for(int i=0; i<N; i++) {

          arr.add(i);

          arr.trimToSize();

      }

      long endTime = System.currentTimeMillis();

      double time = (endTime - startTime)/1000;

      System.out.println("Total time taken = " + time + " seconds.");

  }

}

Explanation:

5 0
3 years ago
What are scientists going to explore next on Kepler-186f? A) evidence of the existence of life B) types of plant life that exist
Volgvan

Answer:

the answer is  a)

Explanation:

4 0
2 years ago
Read 2 more answers
Why aren’t I leveling up? I have enough points and even a brainliest. Could an expert please help me!! I am really confused.
svlad2 [7]
This actually happened to me when I was supposed to be an expert. Answer one more question, log out and back in, and then you should be the next rank!
Hope this helps! Have a happy holiday!
8 0
3 years ago
Is a program that hides in a computer or mobile device and allows someone from a remote location to take full control of the com
antoniya [11.8K]
Yes there are such programs/viruses.

5 0
3 years ago
Which is a feature of a search engine? stores web pages belonging to a single website displays web pages within a browser finds
faltersainse [42]
Finds web pages that matches key words
8 0
2 years ago
Other questions:
  • Paul is the web page designer for his company. Paul’s boss tells him that customers have been complaining that it is difficult t
    8·2 answers
  • What is the term for the process of gathering information through images taken at a distance?
    13·1 answer
  • You can execute three main types of linux commands. what are they?
    8·1 answer
  • To keep a desktop computer or a server powered up when the electricity goes off in addition to protection against power fluctuat
    8·2 answers
  • Naseer has inserted an image into his document but needs the image to appear on its own line.
    14·2 answers
  • Networks that are designed to connect similar computers that share data and software with each other are called:
    10·1 answer
  • A cybersecurity analyst is currently investigating a server outage. The analyst has discovered the following value was entered f
    9·1 answer
  • What kind of server connects a remote system through the internet to local serial ports using tcp/ip?
    9·1 answer
  • What is a text based language that can be used to build all kinds of things ????
    9·1 answer
  • How do you properly turn off a computer?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!