APCSP Unit 3

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/18

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 8:15 PM on 1/23/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

19 Terms

1
New cards

What is a variable in programming?

An abstraction inside a program that can hold a value.

2
New cards

How is an index used in relation to lists or strings?

It is a method for referencing the elements using natural numbers.

3
New cards

What is an element in a list?

An individual value in a list that is assigned a unique index.

4
New cards

What does a group represent in programming?

A collection of shapes treated as a single shape.

5
New cards

How do you move every shape in a group to the right by 5?

Use g.centerX += 5.

6
New cards

What properties can be used with groups?

centerX, centerY, right, left, top, bottom, fill, opacity, visible, and rotateAngle.

7
New cards

What is the purpose of group.children?

It is a list of every shape in the group.

8
New cards

How can you access properties of each individual shape in a group?

Loop through group.children using for shape in group.children:.

9
New cards

When is a shape removed from a group?

If the shape is made invisible.

10
New cards

What are global variables?

Variables defined outside of functions and can be used anywhere below the line where defined.

11
New cards

When should you use local variables?

Only within the function in which they are defined.

12
New cards

What is a helpful type of local variable?

Helper variables that make code easier to read.

13
New cards

How can you store multiple values in programming?

Using a list, like colorList = ['red', 'green'].

14
New cards

How do you access elements in a list?

By indexing into the list, which starts at 0.

15
New cards

What happens if you try to access an out of bounds index in a list?

You will receive an out of bounds error.

16
New cards

What operator do you use to avoid out of bounds errors when cycling through lists?

The mod operator (%) to return indices within the bounds of the list.

17
New cards

What does the colorList.append() method do?

It adds an element to the end of the list.

18
New cards

What does the colorList.insert() method do?

It inserts an element at a specified index in the list.

19
New cards

How does the colorList.remove() method work on the AP Exam?

It behaves like colorList.pop() which removes an element at a specified index.