Loops - Reading Assignment

  1. Looping allows us to go back to a point in the program where we created a condition and repeat it instead of having to rewrite it it literally, “loops”.

2)They repeat a certain code indefinitely or until a condition has been met.

  1. A while Loop runs until the condition is false, the do part runs indefinitely whether the condition is true or false.

  2. spaces/ breaks at the beginning of a code that do not affect the actual code they just make it easier and neater to visualize the work.

1 Like
  1. They allow us to go back to some point in the program where we were before and repeat it with our current program state.

  2. They run over and over again till a certain condition is met.

  3. A do loop always executes its body at least once, and it starts esting whether it should stop only after that first execution.

  4. Grouping your code so it is easier to understand/see/check. It is not needed (instead of for example python) but it makes it easier.

1 Like
  1. What is looping control flow allowing us to do? Continuously execute a section of code, while maintaining the most recently executed state of the program.
  2. Describe what “loops” do in your own words. Execute a piece of code until a certain set of pre-determined conditions are met.
  3. What is the difference between while and do-loops? While loops repeat continuously (given certain conditions), while do loops are executed at least once.
  4. What is indentation? Structuring lines of code for ease of viewing.
1 Like

i. What is looping control flow allowing us to do? Repeat a section of code until a condition is false.

ii. Describe what “loops” do in your own words. A loop executes a section of code over and over.

iii. What is the difference between while and do-loops? In a while statement, the loop is executed until its argument is false. In a do loop, the loop body is executed at least once, and continues to be executed until the while argument is false. In both, the loop can be exited with a ‘break’ statement.

iv. What is indentation? Indentation is positioning a section of code to the right and makes the fact that the code is looping stand out

1 Like
  1. Looping control flow allows a program to go back and repeat a command.
  2. Looping allows us to continue repeating a process over and over until we get a certain result or reach a defined point.
  3. while will run until the condition is false…do will run the program once whether conition is true or false.
  4. Indentation is adding spaces before words in the code so that the humans can read and recognize it more easily. It in no way affects the execution of the program.
1 Like

Looping control flow allows us to execute the same piece(s) of code repetitively until a command is given to end the loop or restart the loop

Loops basically are replacing adding 1000’s of lines of code with one piece of code that executes the same function until a specific piece of data is reached which is established in the code.

A while loop is a loop that will execute while the parameters allow it. A do loop is a loop that will execute once

        Indentation, is used to allow code writers an easier way to view the code.  AlthoughItCanBeWrittenInOneLineItIsLessCommonAndHarderToRead.
1 Like
  1. What is looping control flow allowing us to do?
    ⁃ Looping control flow allows us to go back to some point in the program where we were before and repeat it with our current program state.

  2. Describe what “loops” do in your own words.
    ⁃ loops allow you to run a specific type of program over and over, until the value that the program is pushing out is “true”.

  3. What is the difference between while and do-loops?
    ⁃ A do loop always executes at least once and from the start it decides whether to stop or not after the first execution.

  4. What is indentation?
    ⁃ indentation does nothing for the program it simply helps with the visual aspect. Its a lot simple and easier for most people to look at and identify what part of the program they are looking at.

1 Like
  1. & 2. It allows us to execute a function over and over again.

  2. A while loop keeps executeing aslong as the value is true.
    After a do loop executes ones than it checks wether it should stop.

  3. Indentations are completly optional, that just help you to understand the code better.

1 Like
  1. What is looping control flow allowing us to do?
    It allows us to go back to some point in the program where we were before and repeat it with our current program state.

  2. Describe what “loops” do in your own words.
    Allows one to run a piece of code multiple times- this creates less work for the programmer.

  3. What is the difference between while and do-loops?
    A while loop creates a loop. A do loop is a control structure similar to a while loop. It differs only on one point; a do loop always executes its body at least once and it starts testing whether it should stop only after that first execution.

  4. What is indentation?
    The role of indentation inside blocks is to make the structure of the code stand out. With proper indentation , the visual shape of a program corresponds to the shape of the blocks inside it.

1 Like

What is looping control flow allowing us to do?

Enables us to return to a previous point in the program, and repeat it.

Describe what “loops” do in your own words.

Loops enable us to run a piece of code multiple
times, according to certain specified conditions or variables. Allows greater efficiency with fewer lines of code.

What is the difference between while and do-loops?

A while loop executes a block of code over and over as long as a specified condition is true.

A do loop is a variant of the while loop. This loop will execute once, then check if the condition is true, then it will repeat the loop as long as the condition is true. The test portion of the code is placed after the body of the loop.

What is indentation?

Indentation is a way of formatting the code visually to make it easier to discern where blocks of code begin and end.

1 Like
  1. What is looping control flow allowing us to do?

It allows us to run a piece of code multiple times without having to write each instance.

  1. Describe what “loops” do in your own words.

Loops repeat a section of the program until it is told to stop.

  1. What is the difference between while and do-loops?

While looks keep entering that statement as long as the expression produces a value that gives “true” when converted to Boolean. A do loop always executes its body at least once, and starts testing whether it should stop only after that first execution.

  1. What is indentation?

Indentation is adding spaces in front of statements that are part of a larger statement. It is not required, but it makes the structure of the code stand out.

1 Like

Looping control flow allows us to repeat tedious functions while returning to the place we started from without changing the current state of the environment. With Looping control flow the program returns to the start of a conditional execution with the current program state saved in the memory. Looping lets us proceed with a new branch of the program once all values meeting the conditions of the loop have been executed. While Loops
are operations that run contingent upon the true state of a boolean value so if the value us not true from the first execution, a new branch will begin before the loop is complete. A do loop always runs completely through the line at least once, and it starts testing whether it should stop only after that first line is complete.
Indentations are spaces in code for easier readability.

1 Like
  1. Looping Control Flow allow us to execute a block of code a number of times.
  2. Loops execute a block of code while a condition is fulfilling
  3. do loops will execute the code once before checking the condition of the loop.
  4. Indentation makes code more readable and structured. (Tab)
1 Like
  1. What is looping control flow allowing us to do? It allows us to repeat a set of instructions until a particular ‘exit’ condition is met.

  2. Describe what “loops” do in your own words. It asks if a condition is true, and then if so allows execution of the loops code. When the code is complete, it goes back to check if the condition is still true. This continues until the condition is false, upon which the loop is exited and the following code is executed as normal.

  3. What is the difference between while and do-loops? A while loop asks the condition at the beginning of the statement, and continues to execute the code until it is false. It will not run at all if the initial condition is false. A do loop will always execute at least once, and continue until the condition, that is asked at the end of the statement, is false.

  4. What is indentation? Indentation is the amount of space from the left margin of the editing area. It makes reading the code easier when used correctly. ie. the actions inside a statement should be indented slightly more than the statement declaration and its closing bracket so that it is clearer to see A) what the statement is asking, and B) what the action will be.

1 Like
  1. What is looping control flow allowing us to do?
    it’s the way loops are executed in the program and the allow us to repeat specific pieces of code for a specific number of times or non stop while the program runs

  2. Describe what “loops” do in your own words.
    loops repeat a piece of code and depending on the type of loop it might require a condition to stop

  3. What is the difference between while and do-loops?
    while loops evaluate its condition at the beginning of the loop and do loops evaluate their condition at the end of the loop so the program can access the do loop at least once without checking the condition.

  4. What is indentation?
    the blank spaces left at the beggining of the line and is a technique used to make code easier to read and more aesthetically pleasing since it brings the big structure of the program out

1 Like
  1. Looping control flow is allowing us to go some point in the program we were before and repeat it with our current program state.

  2. Whenever we need to do same tasks over and over again, we can do so by creating a loop, instead of writing those repeated instructions multiple times. This concept is called loops

  3. Do-while loop execute at least once, a while loop may not execute even once, if the while condition returns false in the 1st instance itself

  4. Indentation is the way the program is written in terms of spacing, starting a new line etc for the purpose of better readability

1 Like
  1. It allows us to go back in a program to repeat a condition until it has reach an requirement to stop program or move on to the next.
  2. It allows for the repetition of a process until a certain condition is met.
  3. While loops validate the condition before executing the loop while do-loops loops the block at least once.
  4. Its a way to structure the code as to make it easier to read.
1 Like

What is looping control flow allowing us to do?
A way to run a piece of code multiple times.
Describe what “loops” do in your own words.
It is a repetition of a process until a certain condition is met.
What is the difference between while and do-loops?
A do loop always executes its body at least once, and it starts testing whether it should stop only after that first execution.
What is indentation?
It is a structure to make the code stand out.

1 Like
  1. What is looping control flow allowing us to do?

Looping control flow allows us to go back to some previous point in the program and repeat it with current program state or in other words It allows us to run a piece of code multiple times.

  1. Describe what “loops” do in your own words.

“Loops” are disturbing linear control flow in a way that they make piece of code run multiple times as long as predefined condition is true. Only way to finish the loop is having looping condition produce false or if we break out of the loop with special statement “break”.

  1. What is the difference between while and do-loops?

The while loop will first test its looping condition and will start to run code in its body only if this condition is true and will keep running as long as the looping condition produces a value that is true, while a do-loop will always executes its body at least once, and only then will start testing whether it should stop after that first execution.

  1. What is indentation?

Indentation is adding spaces in front of statements that are part of some larger statement. Indentation is not necessary and it doesn’t affect the execution of a code but it makes the structure of the code stand out. In code where new blocks are opened inside other blocks, it is hard to see where one block ends and another begins. With proper indentation, program has better visual structure and code is easier to read and modify.

1 Like
  1. What is looping control flow allowing us to do?
    Looping control flow allows us to go back to some point in the program where we were before and repeat it with our current program state.

  2. Describe what “loops” do in your own words.
    Can repeat a task untill is programmed to stop.

  3. What is the difference between while and do-loops?
    A do loop always executes its body at least once, and it starts testing whether it should stop only after that first execution.

A while loop keeps entering that statement as long as the expression produces a value that gives true when converted to Boolean.

  1. What is indentation?
    Indentation is the visual shape of a program.The indentation inside blocks make the structure of the code stand out.
1 Like