Back to marketplace

Unit 6-lists, loops, and transversals

No description yet. This curated deck is ready for daily study.

Total cards: 19•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (19)

#1
Front (Question)

list

Back (Answer)

an ordered collection of elements

#2
Front (Question)

element

Back (Answer)

an individual value in a list that is assigned a unique index

#3
Front (Question)

index

Back (Answer)

a common method for referencing the elements in a list or string using numbers (lists in Javascript start with index 0

#4
Front (Question)

length

Back (Answer)

how many elements it contains, The length of the list is 1 more than the last index

#5
Front (Question)

How are lists an example of data abstraction?

Back (Answer)

They allow us to name and program with large collections of information while ignoring the low level details of how the data is stored, organized, etc.

#6
Front (Question)

what is a While Loop and how does it work?

Back (Answer)

uses a boolean condition to repeatedly run a block of code. If it is true it runs the block of code contained within it. -This process of checking the condition and running the block of code is repeated as long as the Boolean condition remains true. -Once the Boolean expression becomes false it will stop.

#7
Front (Question)

for Loop

Back (Answer)

condenses the parts of a while loop into a shorter statement. Like the while loop, once the Boolean expression becomes false, the loop ends.

#8
Front (Question)

What are the three components of for and while loops?

Back (Answer)

Create a count/index variable Ex. var count = 0 Write a while loop to check a condition Ex. while (count <10)… Increase/Decrease the value of count/index variable Ex. …count ++

#9
Front (Question)

What is an iteration and what is an example?

Back (Answer)

Iteration (loops): a repetitive portion of an algorithm which repeats a specified number of times, while a condition is met, or until a given condition is no longer met - an example is loops!

#10
Front (Question)

What is in an infinite loop and when do they occur?

Back (Answer)

occurs when the while condition is always true (or the ending condition will never occur); will result in cycling through a set of commands forever without stopping

#11
Front (Question)

When would you want to use a loop versus a function

Back (Answer)

Use a function when you have a piece of code (a procedure) that you might reuse in other places in your program. Use a loop when there is something you need to do over and over again repeatedly (consecutively) or when you don’t want to call a function many times in a row manually. Use a loop when you don’t want to call a function many times in a row manually

#12
Front (Question)

What is a simulation and why is it important?

Back (Answer)

Simulations are models of the real world that allow the user to investigate hypotheses and draw conclusions by inputting various sets of data or values to demonstrate the changing state of a phenomenon. -Simulations allow us to test solutions or run experiments in a way that is usually cheaper, safer, and often times faster.

#13
Front (Question)

algorithm

Back (Answer)

finite set of instructions that accomplish a specific task.

#14
Front (Question)

what is the definition of a traversal?

Back (Answer)

the process of accessing each item in a list one at a time

#15
Front (Question)

how do lists relate to abstraction?

Back (Answer)

they manage complexity in programs by giving a collection of data a name without referencing the specific details of the representation.

#16
Front (Question)

what is the definition of a loop?

Back (Answer)

change the sequential flow of control by repeating a set of statements zero or more times, until a stopping condition is met

#17
Front (Question)

what is another term for a loop?

Back (Answer)

iteration statement

#18
Front (Question)

what is a substrsing?

Back (Answer)

a part of an existing string

#19
Front (Question)

Back (Answer)