Unit 3 Lesson 8 and 10
Unit 3 Lesson 8 and 10
Unit 3 Lesson 8 and 10
Notes
Iteration - Repitition of a Process
For Loop - repeats a function for a set number of times; I is the number of times repeated
While Loop - used to repeat a section of code an unknown number of times until a specific condition is met
Initialization - What sets the counter variable to a starting value. For example (var i = 0) represents an initial value of 0.
Condition - Allows the computer to know whether or not to keep repeating the loop.
increment/decrement - Modifies the counter variable after each repetition.
Indexing / List Index - The position of an element in a list, starting from 0
append, remove, pop - Various methods, append adds an element to the end, remove removes at an index, and pop removes the last item.
Elements [in a list] - An item in a list.
Nesting - Having one data type or function inside another data type or function, such as lists or loops.
array - Another name for a list, depends on the language
Exercise 1 and 2
Multple Choice Quiz Score: 9/10
Correction
The question confused me at first as I thought the answer was WHILE loop. My thinking was that a while loop continues to repeat until a condition is met, which in this case was when the user inputs ‘quit’. The right answer is FOR loop because when iterating over a list it will continue to repeat unitl the user quits. While loop is more appropriate for conditional statements.
Reflection
These lessons were a bit challenging at first but with perserverance I was able to understand the concepts which allowed me to perform the hacks well. The presentation was great and I learned a lot from it.