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
suter [353]
2 years ago
12

Describe a situation in a program where you could write and use a "for loop".​

Computers and Technology
2 answers:
kykrilka [37]2 years ago
8 0

Answer:

  • Use the one that reads most clearly.
  • If you can’t decide, just pick one.
  • If you can’t then use for()
  • If at any point later in time you change your mind, refactor your code.

This is how professionals work. Decide, and for all things with low impact to change, don’t sweat it.

Save that for architectural and API design choices.

Answer#2:

  • Well if you are looking for a simple technique to choose which loop to use you can use these rules.
  • Use for loops when there's a sequence of elements that you want to iterate.
  • Use while loops when you want to repeat an action until a condition changes.

And if whatever you are trying to do can be done with either for or while loops then just choose your favourite :)

Marina86 [1]2 years ago
8 0

Answer: You can use a for loop for situations such as a questionnaire, data collection etc.

Explanation:

A 'For Loop' is a loop variable. As I said before, you can use it in instances such as questionnaires and data collection. To use a For Loop in Python simply type "for [VARIABLE] in range([HOW LONG YOU WANT THE LOOP TO GO]):. Indentation is key for this, so remember to always end this line of code with a colon.

You might be interested in
your computer running Windows 10 is doing some very strange things with operating system you are fairly certain it is not a hard
AlekseyPX
It might be a virus, when my computer starts going crazy i just bought a fixme stick and they work amazing or trying getting an expert to fix it if it worse
6 0
3 years ago
Read 2 more answers
High speed printer that produce higher quality printouts but are more expensive is
lukranit [14]

Answer:

i think its D, laser printer

Explanation:

8 0
3 years ago
Al and Bill are arguing about the performance of their sorting algorithms. Al claims that his O(N log N)-time algorithm is alway
lisabon 2012 [21]

Answer:

See in Explanation

Explanation:

All you know is that an O(n log n) algorithm is eventually (a lot) faster than an O(n^{2} ) algorithm, but for any specific value of n, you can't say anything. Indeed, the asymptotic growth of the function doesn't depend on its value on n. This means that if  f(n)=O(n^{2} ) then for all c_{1} ,....\ , c_{99}, the following function is also O(n^{2} ):

f^{'} (n)=[\ cnf(n)\  if \ n

So asymptotic notation is completely uninformative regarding the performance of algorithms on specific values of n.

You could say that functions such as f^{'}(n) are artificial and never really occur in practice. This is not quite true (you can hard-code some auxiliary information for small n, for example), but even if you consider "natural" functions, asymptotic notation doesn't help you to determine anything other than asymptotic's: consider for example n^{2} against 10^{100}n\  log \ n (such examples definitely happen in practice, for example in fast matrix multiplication).

7 0
3 years ago
Marty uses a customized database to sort parts and track inventory. The customized database is an example of _____.
MakcuM [25]

cataloging, that is a term for it.

3 0
3 years ago
the header, in an academic report, typically contains the author’s name and the current page number true or false
kolbaska11 [484]
TRUE

True


In most academic reports, most specifically, an MLA academic report, Student’s last name and current page number is contained in the headers. In MLA, which is most common used formatting guide in academic reports, headers numbers all pages consecutively within the right margin.


6 0
3 years ago
Other questions:
  • Which of these does an open office or Microsoft Office wizard do?
    7·1 answer
  • Is the protocol that specifies how web browsers and servers communicate.?
    11·1 answer
  • "the most common way to access the internet is through ________."
    5·1 answer
  • Packet ________ is a form of protection for your computer that looks at each packet that comes into your computer network. scree
    15·1 answer
  • Once you create a slide show, it is not easy to rearrange things, so you should plan your presentation ahead of time.
    14·1 answer
  • Write a function to output an array of ints on a single line. Funtion Should take an array and an array length and return a void
    9·1 answer
  • I'll give brainlyist
    9·2 answers
  • Why is a Quality assurance tester needed on a software development team?
    5·1 answer
  • Hello can someone help with the output of this please?
    5·1 answer
  • 2. Why do you think the order of operations still applies in Java? Give an example to show what could happen if you didn't use o
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!