AP CSP: Unit 4

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/70

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

71 Terms

1
New cards

Which of the following statements will change “tennis” to “gaming” ?:

var hobbies = [“tennis”, “reading”, “football”, “hiking”];

  1.  hobbies[1] = “gaming”;

  2.  hobbies[“tennis”] =   “gaming”;

  3.  hobbies.pop(“tennis”);

  4.  hobbies[0] = “gaming”;

Indexing starts at one!

1

2
New cards

How to print out index 1?

// A variable can hold a whole list or array instead of just one value!

var arr = [5, 8, 103, 32, 7];

println(arr[0]);

println(arr[2]);

var shoppingList = ["bread", "eggs",

"milk", "cookies"];

// Let's print out index 1

// Let's get cake instead of milk

println(shoppingList[2]);

shoppingList[2] = "cake";

println(shoppingList[2]);

}

println(shopping list[1]);

3
New cards
4
New cards

Create an array of the top 5 places you would like to travel called travelList. Print out the element at index 2.

The element is the individual value in a list that is assigned a unique index.

The index is the method for referencing the elements in a list. Rememeber that the index starts at zero!

function start(){

//Make travle list variable

var travelList = ["Florida" , "The Bahamas", "Ireland", "England", "Paris"];

//Print out element at index two

println(travelList[2]);

}

5
New cards

Create an array (the list must have the name numList) of the first 5 prime numbers starting at 2. Print out the items at index 0, 2, and 4.

function start(){

//Num list array

var numList = [2, 3, 5, 7, 11];

//Print out items at index 0, 2, 4

println(numList[0]);

println(numList[2]);

println(numList[4]);

}

6
New cards

Consider the following code segment.

aList ← [15, "hello", true] 

Which element can be found at index 2?

hello

7
New cards

Which of the following will create an empty list and assign it to aList?

  1. aList ← 0

  2. aList ← [0]

  3. aList ← [ ]

  4. aList ← " "

3

8
New cards

Consider the following code segment.

aList ← [20, 40, 60]
bList ← [10, 30, 50]
aList ← bList
bList ← [15, 45, 90]

What is stored in aList?

  1. [15, 45, 90]

  2. [10, 30, 50]

  3. [20, 40, 60]

  4. [ ] (empty set)

2

9
New cards

The indices on the exam are different. They do not start at 0, but rather at 1.

aList ← ["dog", false, "bird"] 

Which of the following will throw an error?

I. aList[0]
II. aList[2]
III. aList[3]
IV. aList[4]

  1. I and II

  2. I and IV

  3. II and IV

  4. III and IV

2

10
New cards

What is an array (or list)?

  1. An ordered collection of items

  1. An unordered collection of items

  2. A function

  3. A type of loop

1

11
New cards

We want to make a grocery list in our program. Which of the following is the correct way to make an array/list?

  • 1.

var groceries = "milk, sugar, eggs, cake";

JavaScript

  • 2.

var groceries = ["milk, sugar, eggs, cake"];

JavaScript

  • 3.

var groceries = ["milk" "sugar" "eggs" "cake"];

JavaScript

  • 4.

var groceries = ["milk", "sugar", "eggs", "cake"];

JavaScript

4

12
New cards

What is the index of the very first item in a JavaScript array?

  1. 0

  2. 1

1 —> 0

13
New cards

var shoppingList = ["milk", "eggs", "sugar", "bread", "cake"];

JavaScript

Which line of code will correctly change "cake" to "apples"?

  • 1.

shoppingList["cake"] = "apples";

JavaScript

  • 2.

shoppingList["apples"] = "cake";

JavaScript

  • 3.

    shoppingList[4] = "apples";

    JavaScript

  • 4.

    shoppingList[5] = "apples";

    JavaScript

3.

14
New cards

What would go in the bold?

function start(){

var shoppingList = ["bread", "eggs", "milk", "cookies"];

println(shoppingList[0]);

println(shoppingList[1]);

println(shoppingList[2]);

println(shoppingList[3]);

shoppingList[2] = "tuna";

println(shoppingList[2]);

var idx = 0;

//What would go here?

var val = shoppingList[1];

println(val);

}

println(shoppingList[idx]);

15
New cards

Create an array of your favorite 4 movies. Print out the 0th element in the array. Now set the 0th element to be “Star Wars” and try printing it out again.

function start(){

// Favorite movies

var favMovies = ["Cruella", "The Secret Garden", "Home Alone",

"A Christmas Carol"];

//Print fav movie 0

println(favMovies[0]);

//Set 0 element to be Star Wars

favMovies[0] = "Star Wars";

println(favMovies[0]);

}

16
New cards

Answer the questions:

function start(){

var arr = [];

arr.push(5);

println(arr[0]);

println(arr[1]);

//Push does what?

arr.push(12);

arr.push(1);

arr.push(1000);

arr.push(3);

println(arr[4]);

//Pop does what?

var last = arr.pop();

println(last);

println(arr[4]);

}

Push lets you add to the array, ppop removes the last element

17
New cards

Lists and arrays are an example of a data abstraction.

A data abstraction can often contain different types of elements. It also provides a separation between the abstract properties of a data type (integer, boolean, string) and the concrete details of its representation. Basically, it doesn’t matter that the types are different!

Create an empty array. Push the integer 3, a string of “hello” and a boolean of false into the array. Print out each index individually. Now, pop the last two elements.

Now, print out the first three values again.

function start(){

//Create empty array

var emptyArr = [];

//Push integer 3, "hello," false

emptyArr.push(3);

emptyArr.push("hello");

emptyArr.push(false);

//Print out each index

println(emptyArr[0]);

println(emptyArr[1]);

println(emptyArr[2]);

//Pop last two elements

emptyArr.pop();

emptyArr.pop();

//Print first three values

println(emptyArr[0]);

println(emptyArr[1]);

println(emptyArr[2]);

}

18
New cards

What index refers to the “end” of an array?

  1. The lowest index, index 0

  2. The highest index

2

19
New cards

var numbers = [0, 1, 2, 3, 4];

JavaScript

How can we add a 5 to the end of numbers?

numbers[5] = 5;
numbers[0] = 5
numbers.push(5);
numbers.pop(5);

3.

20
New cards

var numbers = [0, 1, 2, 3, 4, 5];

JavaScript

How can we remove the last item from the end of the numbers array and store it in a variable called value?

var value = numbers[5];
var value = numbers.pop();
var value = numbers.push();
var value = numbers;

2.

21
New cards

How can we get the length of an array arr?

  1. arr.len

  2. arr.length

  3. length(arr)

  4. arr.length()

2.

22
New cards

Which loop will correctly loop over the array arr and print each value inside of it?

for(var i = 0; i < arr.length(); i++){
    var curr = arr[i];
    println(curr);
}
for(var i = 1; i <= arr.length(); i++){
    var curr = arr[i];
    println(curr);
}
for(var i = 0; i < arr.length; i++){
    var curr = arr[i];
    println(curr);
}
for(var i = 1; i <= arr.length; i++){
    var curr = arr[i];
    println(curr);
}

2.

23
New cards

function start(){

var arr = ["bread", "eggs",

"milk", "cookies"];

//What goes here?

var cur = arr[i];

println(cur);

}

var list = ["bread", "eggs", "milk", "cookies", "bananas", "tuna", "lettuce", "yogurt", "cheese", "chicken", "cucumbers", "orange juice", "salt", "doritos", "lemonade", "apples", "paper towels", "red onion", "minced garlic", "tumeric", "donuts", "bagels", "crackers", "red pepper", "green pepper", "spinach", "canola oil", "vanilla", "flour", "brown sugar", "powdered sugar", "lime"];

for(var i = 0; i < list.length; i++){

println(list[i]);

}

}

for(var i = 0; i < arr.length; i++){

24
New cards

Traverse through a loop with the list ["bread", "eggs", "milk", "cookies", "bananas", "tuna", "lettuce", "yogurt", "cheese", "chicken", "cucumbers", "orange juice", 'lime, potatoes']; and print the first five items in that list

function start(){

var list = ["bread", "eggs", "milk", "cookies", "bananas", "tuna", "lettuce", "yogurt", "cheese", "chicken", "cucumbers", "orange juice", 'lime, potatoes'];

// Prints the first 5 items in the list

for(var i = 0; i < 5; i++){

println(list[i]);

}

// Prints the first half of the list

for(var i = 0; i < list.length/2; i++){

println(list[i]);

}

}

25
New cards

function start(){

var arr = [1, 8, 123, 103, 992,

21, 2, 2, 144, 523,

13, 90, 77, 12, 13];

var sum = 0;

for(var i = 0; i < arr.length; i++){

var cur = arr[i];

//What goes here?

}

println(sum);

}

sum += cur;

26
New cards

// This code segment traverses through the array and prints the maximum

// value.

// Challenge: Can you change this code so that the min value is printed?

function start(){

var arr = [1, 8, 123, 103, 992,

21, 2, 2, 144, 523,

13, 90, 77, 12, 13];

var max = arr[0]

for(var i = 0; i < arr.length; i++){

if (arr[i] > max){

max = arr[i];

}

}

println(max);

}

27
New cards

Write a program that outputs the product (the result of multiplying together) all of the elements in an array.

Create an array arr with the values [1, 8, 3, 4, 2, 9].

The answer should be 1728.

function start(){

//Arr

var arr = [1, 8, 3, 4, 2, 9];

//Set total = 1

var total = 1;

//Multiply them

for(var i = 0; i < arr.length; i++){

var cur = arr[i];

total *= cur;

}

//Print

println(total);

}

28
New cards

Write a program that prints out a flight itinerary. A flight itinerary is a list
of cities, and should be output like this.

For example, if the flights array is

["San Francisco", "New York", "Chicago", "Honolulu"]

You print

San Francisco -> New York -> Chicago -> Honolulu

Helpful Hint: To print multiple times on the same line, use print() instead of println(). For example, this code:

print("hello, ");
print("world");

prints each statement on the same line, giving the output of:

hello, world

function start(){

//Prints out flight itinerary

//Array of flights

var arr = ["San Francisco", " New York", " Chicago", " and Honolulu"];

//Print itinerary

print("Hello, ");

print("world.");

print(" Our flight itinerary is " + arr);

}

29
New cards

Write a function called

function onlyEvens(arr)

That takes an array and returns an array with only the even numbers in the original array.

Then, you should print out the new list.

Consider the following code snippet:

var arr = [1,2,3,4,5,6];
var evens = onlyEvens(arr);
println(evens);

Depending on the environment you are running your code in (a setting you can change in your editor), your output for the code above can look like this:

2,4,6

Or this:

[2,4,6]

Both outputs are acceptable for this exercise.

//Var evens

var evens = [];

//Var arr

var arr = [1, 2, 3, 4, 5, 6,];

function start(){

//Print

onlyEvens(arr);

printEvens(evens);

}

//Function

function onlyEvens(arr){

//Gets arr whole length

for(var i = 0; i < arr.length; i++){

//If arr even/odd statement

if(arr[i] % 2 == 0){

evens.push(arr[i]);

}

}

}

function printEvens (evens){

for(var i = 0; i < evens.length; i++){

println(evens[i]);

}

}

30
New cards

What if arrays did not exist?!

Using the variables below, write a function named oddOrEven that checks if each variable is an even or odd number and prints out the result.

var num1 = 15;
var num2 = 32;
var num3 = 19;
var num4 = 11;
var num5 = 28;
var num6 = 24;

function start(){

var num1 = 15;

var num2 = 32;

var num3 = 19;

var num4 = 11;

var num5 = 28;

var num6 = 24;

oddOrEven(num1);

oddOrEven(num2);

oddOrEven(num3);

oddOrEven(num4);

oddOrEven(num5);

oddOrEven(num6);

}

function oddOrEven (num){

if(num % 2 == 0){

println("even");

}else{

println("odd");

}

}

31
New cards
function start(){
    //this array is filled with several Rectangle objects
    var rectangleArray = [...];

    //your code here
    ...
}

function updateRectangle(rect){
    //changes the color of rect to a random color
    rect.setColor(Randomizer.nextColor());
}

JavaScript

We have an array of Rectangles called rectangleArray and a function updateRectangle(rect) that takes a single rectangle as a parameter and changes its color to a random color. How can we easily change the color of every rectangle inside rectangleArray?

hange the color of every rectangle inside rectangleArray?

updateRectangle(rectangleArray[0]);
updateRectangle(rectangleArray[1]);
...
updateRectangle(rectangleArray[100]);
...
updateRectangle(rectangleArray[rectangleArray.length - 1]);
updateRectangle(rectangleArray);
for(var i = 0; i < rectangleArray.length; i++){
    updateRectangle(rectangleArray[i]);
}

3

32
New cards

What kinds of items can we store in arrays?

  1. numbers only

  2. strings of text only

  3. numbers or strings of text

  4. any kind of object (anything you can store in a variable)

4.

33
New cards

*/

function start(){

var flips = flipCoins();

//What goes here?

}

// This function should flip a coin NUM_FLIPS

// times, and add the result to an array. We

// return the result to the caller.

function flipCoins(){

var flips = [];

for(var i = 0; i < NUM_FLIPS; i++){

if(Randomizer.nextBoolean()){

//What goes here?

}else{

flips.push("Tails");

}

}

return flips;

}

function printArray(arr){

for(var i = 0; i < arr.length; i++){

//What goes here?

}

}

printArray(flips);, flips.push("Heads");, println(i + ": " + arr[i]);

34
New cards

var RADIUS = 40;

var NUM_CIRCLES = 7;

// FLASH WARNING: Photosensitive individuals should not set DELAY to a value

// below 300. (i.e. rates that flash greater than three frames per second)

var DELAY = 350;

var circles = [];

function start(){

createCircles();

setTimer(goCrazy, DELAY);

}

function createCircles(){

for(var i = 0; i < NUM_CIRCLES; i++){

//What goes here?

updateCircle(circle);

add(circle);

circles.push(circle);

}

}

function goCrazy(){

for(var i = 0; i < circles.length; i++){

updateCircle(circles[i]);

}

}

function updateCircle(circle){

var x = Randomizer.nextInt(

RADIUS, getWidth() - RADIUS);

var y = Randomizer.nextInt(

RADIUS, getHeight() - RADIUS);

//What goes here?

circle.setColor(Randomizer.nextColor());

}

var circle = new Circle(RADIUS);, circle.setPosition(x, y);

35
New cards

Starting with our program that creates an array of coin flips, add a function that prints out the total number of heads and total number of tails flipped.

Your function should take the array of flips as a parameter like this:

function countHeadsAndTails(flips) {
    // your code here
}

var NUM_FLIPS = 100;

function start(){

var flips = flipCoins();

printArray(flips);

}

// This function should flip a coin NUM_FLIPS

// times, and add the result to an array. We

// return the result to the caller.

function flipCoins(){

var flips = [];

for(var i = 0; i < NUM_FLIPS; i++){

if(Randomizer.nextBoolean()){

flips.push("Heads");

}else{

flips.push("Tails");

}

}

return flips;

}

function printArray(arr){

for(var i = 0; i < arr.length; i++){

println(i + ": " + arr[i]);

}

}

Add at the end:

function countHeadsAndTails(flips){

var headsTotal = 0;

var tailsTotal = 0;

for(var i = 0; i < NUM_FLIPS; i++){

if(flips[i] == "Heads"){

headsTotal += 1;

}

if(flips[i] == "Tails"){

tailsTotal += 1;

}

}

println("The total heads is " + headsTotal);

println("The total tails is " + tailsTotal);

}

36
New cards

var groceries = ["milk", "eggs", "bread", "cheese", "yogurt", "sugar"];

JavaScript

What will be the result of groceries.indexOf("yogurt"); ?

  1. true

  2. false

  3. 4

  4. 5

3 → 4

37
New cards

var groceries = ["milk", "eggs", "bread", "cheese", "yogurt", "sugar"];

JavaScript

What will be the result of groceries.indexOf("cake"); ?

  1. true

  2. false

  3. undefined

  4. -1

4.

38
New cards

What method can we use to find the index of a particular element in an array?

  1. indexOf

  2. find

  3. findElement

  4. index

1.

39
New cards

function indexOf(arr, str){

for(var i = 0; i < arr.length; i++){

var cur = arr[i];

if(cur == str){

return i;

}

}

return -1;

}

function start(){

var list = ["bread", "eggs", "milk", "cookies", "bananas", "tuna", "lettuce", "yogurt", "cheese", "chicken", "cucumbers", "orange juice", "salt", "doritos", "lemonade", "apples", "paper towels", "red onion", "minced garlic", "tumeric", "donuts", "bagels", "crackers", "red pepper", "green pepper", "spinach", "canola oil", "vanilla", "flour", "brown sugar", "powdered sugar", "lime"];

var idx = indexOf(list, "donuts");

//What goes here?

println(indexOf(list, "apple juice"));

println(list.indexOf("donuts"));

println(list.indexOf("apple juice"));

}

println(idx);

40
New cards

You are given an array of names of people who are in line. Try using if statements and the indexOf
method of arrays to see if Bob is in line.

var line = ["Sam", "Lisa", "Laurie", "Bob", "Ryan"];

var line2 = ["Tony", "Lisa", "Laurie", "Karen"];

You should print whether Bob is in each line. Your console should look something like this:

Bob is in the first line.
Bob is not in the second line.

function start(){

var line = ["Sam", "Lisa", "Laurie", "Bob", "Ryan"];

var line2 = ["Tony", "Lisa", "Laurie", "Karen"];

var one = line.indexOf("Bob");

var two = line2.indexOf("Bob");

if(one != -1){

println("Bob is in the first line.");

}else{

println("Bob is not in the first line.");

}

if(two != -1){

println("Bob is in the second line.");

}else{

println("Bob is not in the second line.");

}

}

41
New cards

What is the output of the following program?

function start(){
    var arr = [1, 2, 3, 4, 5, 6, 7];
    var elem = arr.pop();
    println(arr);
    println(elem);
}
[1, 2, 3, 4, 5, 6]
[7]
[1, 2, 3, 4, 5, 6]
7
[2, 3, 4, 5, 6, 7]
1
[2, 3, 4, 5, 6, 7]
[1]

2.

42
New cards

What is the output of the following program?

function start(){
    var arr = [1, 2, 3, 4, 5, 6, 7];
    var elem = arr.remove(2);
    println(arr);
}
  • 1.

[1, 2, 3, 4, 5]
  • 2.

[3, 4, 5, 6, 7]
  • 3.

[1, 3, 4, 5, 6, 7]
  • 4.

    [1, 2, 4, 5, 6, 7]

4.

43
New cards

function start(){

var arr = [7, 4, 14, 8, 3, 9];

println(arr);

arr.pop();

println(arr);

//What goes here?

//arr.splice(2, 1);

println(arr);

println("We removed: " + elem);

}

var elem = arr.remove(2);

44
New cards

You are given an array of names of people who are in line for movie tickets.

var line = ["Sam", "Lisa", "Laurie", "Bob", "Ryan"];

Write a function that prints the names in the list before removing the first two names. Then, use the .remove() method to remove the first person from the line twice, as if you have just given them their tickets. After, print the names that remain in the list.

The console should print this:

Sam, Lisa, Laurie, Bob, Ryan
Laurie, Bob, Ryan

function start(){

var line = ["Sam", "Lisa", "Laurie", "Bob", "Ryan."];

println(line);

line.remove(0);

line.remove(0);

println(line);

}

45
New cards

The AP Exam uses the following format to iterate through a list.

FOR EACH item IN aList
{
   <block of statements>
}

Given the following code segment, how can you best describe its behavior?

result ← 0

FOR EACH n IN list
{
    IF (n MOD 2 = 0)
    {
        result ← result + n
    }
}

DISPLAY result

  1. This code displays the count of even numbers in list

  2. This code displays the sum of the even numbers in list

  3. This code displays the sum of the numbers at the even indices of list

  4. This code results in an error

2.

46
New cards

The AP Exam uses the following format to add an item to list and to find the length of a list.

APPEND(aList, value)

LENGTH(aList)

Given the following code segment, how can you best describe its behavior?

You can assume number is a positive integer and isPrime(x) returns true if x is prime and false otherwise.

list ← []

i ← 1

REPEAT number TIMES
{
    IF (isPrime(i))
    {
        APPEND(list, i)
    }
    i ← i + 1
}

DISPLAY LENGTH(list)

  1. This code displays the total number of prime numbers between 1 and number

  2. This code displays a list of all of the prime numbers between 1 and number

  3. This code displays the sum of the prime numbers between 1 and number

  4. This code results in an error

1.

47
New cards

Given the following Mystery procedure, how can you best describe the result it returns?

PROCEDURE Mystery (list, target)
{
    length ← LENGTH(list)
    i ← 1

    REPEAT length TIMES
    {
        IF (list[i] = target)
        {
            REMOVE(list, i)
        }
        ELSE
        {
            i ← i + 1
        }
    }
    RETURN(list)
}

  1. This procedure returns the list without the first instance of the given target

  2. This procedure returns the list without any instance of the given target

  3. This procedure returns the list where each instance of the given target is replaced by the index.

  4. This procedure returns the number of times the target appears in the list

2.

48
New cards

The AP Exam uses the following format to insert an item to a list and to generate a random integer from a to b, including a and b.

INSERT(aList, i, value)

RANDOM(a, b)

Given the following code segment, how can you best describe its behavior?

i ← 1

FOR EACH x IN list
{
    REMOVE(list, i)
    random ← RANDOM(1, LENGTH(list))
    INSERT(list, random, x)
    i ← i + 1
}

  1. This code replaces everything in the list with random numbers.

  2. This code shuffles the order of the numbers in the list by removing them and inserting them back in a random place.

  3. This code removes all of the numbers in the list and inserts random numbers in random places in the list.

  4. This code errors by trying to access an element at an index greater than the length of the list.

2.

49
New cards

Write a program that simulates a coin flipping. Each time the program runs, it should print either “Heads” or “Tails”.

There should be a 0.5 probability that “Heads” is printed, and a 0.5 probability that “Tails” is printed.

There is no actual coin being flipped inside of the computer, and there is no simulation of a metal coin actually flipping through space. Instead, we are using a simplified model of the situation, we simply generate a random probability, with a 50% chance of being true, and a 50% chance of being false.

function start() {

if(Randomizer.nextInt(1, 2) == 1){

println("heads");

}else{

println("tails");

}

}

50
New cards

How to index or get “candy” in the array: var shoppingList = [“food”, “candy”, “bread”, “water”];

shoppingList[1]

51
New cards

How to make an index value a variable?

//Turns into diff value

var idx = 2;

list[idx] = “tuna”;

52
New cards

How to code an empty array and add to it and remove the end.

varr arr = [];

arr.push(5);

arr.push(12);

arr.push(3);

var last = arr.pop();

println(arr);

println(last);

//5, 12 will pint then 3 will print

53
New cards

Print out shopping list when looping through arrays.

for(var I = 0; i < list.length; i++){

var curr = arr[i];

println(curr);

}

54
New cards

Simulations mimic real-world events without what?

The cost or danger or building and testing

55
New cards

Simulations are generated based on a ______ of how the real world actually works.

model

56
New cards

Model

A set of rules for how things interact in a simulation

57
New cards

The ______ the model, the faster the simulation.

simpler

58
New cards

Ignore _____, gravity, or having ___ dimensions depending on what you are simulating.

disease, 2

59
New cards

Simulations are good at ________, and they help us test our ______.

predicting, hypotheses

60
New cards

Write a program that simulates a coin flipping. Each time the program runs, it should print either “Heads” or “Tails”.

There should be a 0.5 probability that “Heads” is printed, and a 0.5 probability that “Tails” is printed.

There is no actual coin being flipped inside of the computer, and there is no simulation of a metal coin actually flipping through space. Instead, we are using a simplified model of the situation, we simply generate a random probability, with a 50% chance of being true, and a 50% chance of being false.

function start() {

if(Randomizer.nextInt(1, 2) == 1){

println("heads");

}else{

println("tails");

}

}

61
New cards

List

Also called an array. A data structure that holds a collection of values in a particular order

62
New cards

Push

To add an item to a list or array

63
New cards

Pop

To remove the item in the last position from an array

64
New cards

Data Structure

A particular way of organizing data in our programs.

65
New cards

Array Index

The position of an element in an array. The first element is at index 0, the second element is at index 1, and so on.

66
New cards

Indexing into an array

Getting a value at a particular index in an array.

67
New cards

array.length

Returns the length of the array

68
New cards

array[index]

Accesses an element in the array to either update or retrieve.

69
New cards

Simulation

An animated model that represents a real-life thing, process, or situation.

70
New cards

remove(index)

This function removes an element from the given index position.

71
New cards

Array

Also called a list. A data structure that holds a collection of values in a particular order