Loops - Reading Assignment

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

Looping control flow allows going back to some point in the program to repeat code in current program state

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

Loops allow repetition of routine and/or routine of repetition with minimal coding

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

    • WHILE: The loop keeps entering statement as long as the expression produces a value that gives true when converted to Boolean.

    • DO: The loop always executes its body at least once, and starts testing whether it should stop only after that first execution

  2. What is indentation?

Indentation is the process of adding clarity to the program by making code structure stand out, and blocks and control flow obvious by revealing where certain blocks of code ends and others begins

1 Like
  1. What is looping control flow allowing us to do? To go back to a previous point in the code and repeat it with the current programme state.
  2. Describe what “loops” do in your own words. Loops tell the programme to repeat code, either infinitely or until it reaches a defined value.
  3. What is the difference between while and do-loops? A “while” creates a loop, and requires a boolean state to change to make it stop, a “do” loop always executes at least once before assessing whether it should continue.
  4. What is indentation? Indentation is adding space between text lines. They improve visibility of the layout for yourself and others to read your code. They can be used to isolate blocks of code to make them stand out.
1 Like
  1. What is looping control flow allowing us to do?

in a control flow the code is executed from top to bottom as a story. When we use looping control flow that means that the looping statement will be executed until a counter results false. Then the code continue from the next line

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

Loops help to reduce the amount of code caracters and makes a kind of circle in the control flow. This cicle continues until the counter results true. Some loops nedds to have break because the code can produce infinite loops.

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

Pff. I am not sure I have uderstand the difference. A do loop does minimum one execution inside the statement but I do not know exactly what does this mean. What I think is that while loops has a counter that exactly tell where the loop should finish. So it is good when we count somethig and we work with numbers. But if we work with srting for example we should use “do” loop because it do not have to count, it only have to do what is in the code. For example if the code needs a name the do loop say “thank you” but if nothing is written into the name “prompt” then do loop show something creepy on the prompt.

  1. What is indentation?

we adding spaces in front of statements. It is not required but it is easier to read the code later, if the outfit and the content diverge together.

2 Likes

1.What is looping control flow allowing us to do?
Allows us to go back to a point in the program where we were before and repeat with the current program state.
2.Describe what “loops” do in your own words.
Allows a piece of code to run multiple times.
3.What is the difference between while and do-loops?
A statement with the word “while” creates a loop and the loops keeps the stamen as long as the expression produces a “true” value.
A do-loop always executes its body at least once and it start testing whether it should stop only after that first execution.
4. What is indentation?
A space in the line or statement in order to read the code easily.

1 Like
  1. Looping control flow allow us to go back to a certain point of our program and repeat it with the current program state.
  2. Loops run a block of code all the time until a certain condition is achieved.
  3. The difference between while and do-loops is that while loops through a block of code as long as the condition specified evaluates to true. Do-loops through a block of code once then the condition is evaluated. if the condition is true then the statement is repeated as long as the condition is true.
  4. Indentation only adds structure to the blocks to make the code stand out.
  1. Allowing pc to go back to a certain point , and re-execute the code.
  2. Re-executing the instructions without re-writing code for a certain number of times or till the time, a certain condition is met.
  3. while checks the condition before executing the first time. Do-loops executes the instruction at-least once.
  4. Re-arranging code with spaces and tabs for the programmer to understand code easily.
1 Like
  1. 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. Loops can repeat the part of the program forever or to the point when certain conditions are met.
  3. Do loop always executes its body at least once and it starts treating whether it should stop only after that first execution.
  4. Indenting of the code is simply put good practice by the programmer to make code easily readable by other humans and also by yourself. The computer doesn’t care if it’s looking nice.
1 Like

1- Looping control flow allows to run a piece of code multiple times. It allows us to go back to some point it the program and repeat it with our current program state.

2- it is a repetition of a process until a certain condition/criteria is met

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

4- The role of indentation is to make the structure of the
code stand out. In code where new blocks are opened inside other blocks,
it can become hard to see where one block ends and another begins. 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?
It allows dev’ to automate lines of code in order to avoid multiple repeating manual tasks

Describe what “loops” do in your own words.
It is a command to repeat sequences of instructions in programming in less work until a condition is met

What is the difference between while and do-loops?
WHILE LOOP the condition tested at the beginning of the loop, and if the condition is True, statements inside the loop will execute. It means the While loop executes the code block only if the condition is True.

At the end of the loop, the DO LOOP tests the condition. So, Do While executes the statements in the code block at least once even if the condition Fails.

What is indentation?
Indentation is a way of keeping your code readable both for yourself and others as a structure. It also makes it easier to debug and to notice small syntax errors like a missing semi-colon or a missing closing curly brace

1 Like
  1. Avoid repeating the code again and again, while instead running the code in a loop.
  2. In loops certain binders have value and then that binder is matched with another value, and depending on the boolean value of the expression the code in the loop is executed. This is repeated unless the expression in the loop function is false.
  3. In while loop the commands are executed only when the expression is true. In do loops the command is executed atleast once irrespective of the boolean value.
  4. Indentation allows the blocks and their structure to stand out, therefore assisting in editing.
1 Like
  1. Looping control flow allows us to return to the beginning of a statement until certain condition is met. This allows the statement to be run over and over.

  2. Loops are statements that repeat themselves through defined parameters. They basically change a part of their input, based on the output of the previous cycle of the loop. This in turn can also change the next output.

  3. The difference between while and do loops is that, while the while loop immediately decides whether it meets the parameters for producing a certain output, the do loop always executes once and only then checks whether the parameters are met.

  4. Indentation is a purely cosmetical method to structure code in a way that it resembles the logical structure of a program. We have learned indentation very early on in this course. We can use spaces or tabs to indent a new lean in order to keep the same structure throughout our program.

1 Like
  1. Looping control flow allows to go back to some point in the program where
    we were before and repeat it with our current program state.
  2. A loop keeps repeating till the value gives an expression “true” in a Boolean statement
  3. A do loop always executes its body at least once, and it starts testing
    whether it should stop only after that first execution.
  4. To have a better view of the code… so it’s easier to read.
1 Like
  1. it allows us to repeat a task without programming each step of the computation.
  2. it is a repetition of a process until a certain condition/criteria is met.
  3. While loops first check condition then executes code if the condition is true. The do loops does not check condition at first. The loop is evaluated at the end.
  4. It is a tab which facilitates reading.
1 Like
  1. Loop Control Flow allow us to go back to a certain point of our program and repeat it with a certain flow
  2. Loops is a code used to repeat every function until a value expected be the result
  3. while loop can cause an indefinite result, in do loop the result are already in the environment to be at least have a result and wont go indefinite
  4. Indentation is a way to used spaces and create easier way to view the command and function written in text editor screen
1 Like
  1. What is looping control flow allowing us to do?

It allows us to step out of loops based on some conditional check being met by the program, or even can navigate the program to specific sets of evaluation depending on the program state.

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

Loops are a framework of code and check of condition(s) that is repeatedly used until some condition is met to break or dis-continue the repeated code statements/expression evaluations.

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

A do loop is guaranteed to run at least once, since the conditional statement to determine if the loop continues is evaluated each time after the loop code. A while loop has the evaluation performed prior to execution of the code within the loop.

  1. What is indentation?

It is styling of the code intended to show clear distinct portions of the program (Evaluation expression sections, functions) to help coders identify where specific blocks of code begin and end.

1 Like
  1. Looping allows us to instruct a program to change it’s flow depending on set conditions.

  2. Looping allows us to execute the same set of instructions continually until a condition is met.

  3. A while loop tests a condition and then executes the loop and then continues until the condition is met. A do loop executes and then tests a condition, and continues until the condition is met.

  4. Indentation is used to make code easier for the programmers to read by putting relevant chunks of information together in an easy to see fashion.

1 Like
  1. Looping control flow allows us repeat past functions within the current state of the program.
  2. They run the same code multiple times.
  3. They are similar but a do-loop always executes its body at least once and it tests whether it should stop only after the initial execution.
  4. A visual arrangement of codes so that one can easily orient themselves in perceiving where the block ends and another one begins.
1 Like
1. What is looping control flow allowing us to do?

To repeat a block of code until certain conditions are met.

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

Loops have 2 components, a “condition” that determines when the looping should terminate and a block of code to execute. In a while loop:

  1. The condition is checked before entering the loop and if it evaluates to true enters the loop code. If not the loop code is skipped entirely.
  2. Execution begins at the opening curly brace and continues until it reaches the closing curly braces.
  3. At this point execution returns to the top of the block and checks the while condition again. If it’s still true the loop code block is executed again
  4. Repeat until while condition is false

Note if there is an error in the code the loop may never terminate, this is known as an “infinite loop”.

3. What is the difference between while and do-loops?
  • A while loop checks the condition at the TOP of the loop- i.e. will execute zero or more times
  • A do-while loop checks the condition at the BOTTOM, so will always execute the loop code at least once
4. What is indentation?

Indentation is used to visually highlight the nested structure of code. This allows the developer to tell at a glance which code belongs to which block. This is important to understand to the context and scope of variables in those blocks.

1 Like
  1. What is looping control flow allowing us to do? When your program contains more than one statement, the statements are executed as if they are a story, from top to bottom. Block statements are commonly used with control flow statements ( if , for , while ).

  2. Describe what “loops” do in your own words. Loops offer a quick and easy way to do something repeatedly.

  3. What is the difference between while and do-loops? The do while loop executes the content of the loop once before checking the condition of the while.
    Whereas a while loop will check the condition first before executing the content.

  4. What is indentation? Indentations are there for the humans. They help us read the code. Although, compiler doesn’t care about indentation.

1 Like
  1. Looping control flow alows us to go back to a point in the program and repeat the task with the current program state.
  2. Loops can execute a block of code a number of times.
  3. Do loops always executes its body at least once, and it starts testing
    whether it should stop only after that first execution.
  4. Spaces before the actual code, usefull so the code is more readable.