AP CSP Unit 3 - Intro to Python Code

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

1/39

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards covering core concepts, terminology, error types, data types, operators, and event handling for AP Computer Science Principles Unit 3: Intro to Python Code.

40 Terms

1
New cards

Abstraction

Pulling out specific differences to make one solution work for multiple problems. Allows you to hide details to help you manage complexity, focus on relevant concepts, and reason about problems at a higher level.

2
New cards

Algorithm

A precise sequence of instructions for processes that can be executed by a computer.

3
New cards

Arithmetic Operators

Operators used to perform functions that include multiplication, division, addition, and subtraction.

4
New cards

Binary

A way of representing information using only two options.

5
New cards

Bit

The single unit of information in a computer, typically represented as a 00 or 11. A contraction of "Binary Digit".

6
New cards

Boolean

A single value of either TRUE or FALSE.

7
New cards

Boolean Expression

In programming, an expression that evaluates to True or False.

8
New cards

Code

To write code, or to write instructions for a computer.

9
New cards

Concatenate

To link together or join. Typically used when joining together text Strings in programming (e.g., "Hello, " + name).

10
New cards

Debugging

Finding and fixing problems in an algorithm or program.

11
New cards

Global Variable

A variable that can be used anywhere in a program, unlike a local variable, which can only be used in one portion of a program.

12
New cards

Pseudocode

In computer science, a plain language description of the steps in an algorithm or another system. It often uses structural conventions of a normal programming language, but is intended for human reading rather than machine reading.

13
New cards

Procedure

A term used on the AP Exam for both reporters and commands. Some programming languages distinguish between a function (which returns a value) and a procedure (which performs an operation but does not return a value).

14
New cards

Selection

A generic term for a type of programming statement (usually an if-statement) that uses a Boolean condition to determine, or select, whether or not to run a certain block of statements.

15
New cards

Sequencing

Putting commands in correct order so computers can read the commands; the process of ordering the code.

16
New cards

String

Any finite (measurable) sequence of characters.

17
New cards

Variable

A placeholder for a piece of information that can change.

18
New cards

Programming

Writing instructions for a digital tool.

19
New cards

Command

An instruction for the computer. Many commands put together make up algorithms and computer programs.

20
New cards

Debug

To identify and remove errors from a computer program.

21
New cards

Comments

Descriptive text used to explain portions of code. Comments do not change the way a program behaves, but are important for the human programmer to remember what the code does.

22
New cards

Syntax Error

A mistake in the program where the rules of the programming language are not followed (e.g., missing quotation marks, missing brackets, or misspelled commands).

<p>A mistake in the program where the rules of the programming language are not followed (e.g., missing quotation marks, missing brackets, or misspelled commands).</p>
23
New cards

Runtime Error

An error that does not occur until the program has started to execute but that prevents the program from continuing.

<p>An error that does not occur until the program has started to execute but that prevents the program from continuing.</p>
24
New cards

Logic Error

A mistake in the algorithm or program that causes it to behave incorrectly or unexpectedly (e.g., calculating area using addition instead of multiplication).

<p>A mistake in the algorithm or program that causes it to behave incorrectly or unexpectedly (e.g., calculating area using addition instead of multiplication).</p>
25
New cards

IDE

Integrated Development Environment; a programming environment that includes an editor, compiler, and debugger.

<p>Integrated Development Environment; a programming environment that includes an editor, compiler, and debugger.</p>
26
New cards

Output

Data that has been processed by a program into a useful format, commonly displayed or sent to devices such as monitors, printers, or speakers.

<p>Data that has been processed by a program into a useful format, commonly displayed or sent to devices such as monitors, printers, or speakers.</p>
27
New cards

Input

What is put in, taken in, or operated on by any process or system, typically entered using devices like a mouse, keyboard, scanner, or microphone.

<p>What is put in, taken in, or operated on by any process or system, typically entered using devices like a mouse, keyboard, scanner, or microphone.</p>
28
New cards

print()

Python command that displays a value to the console.

29
New cards

Keyword

Reserved words in Python that cannot be used as identifiers or variable names (e.g., def or print).

30
New cards

str

In Python, stands for string; anything on the keyboard, usually a word or phrase, surrounded by double (") or single (") quotes.

31
New cards

int

In Python, stands for integer; a whole number that can be positive, negative, or 00.

32
New cards

float

In Python, stands for floating point; a decimal number such as 0.00.0, 3.23.2, or 3.143.14.

33
New cards

Variable Assignment

Assigning a value to a variable name using the assignment operator (=), such as var = 10.

34
New cards

String Operators

Operators applied to strings, such as concatenation ("a" + "b" > "ab") or replication (33 * "a" > "aaa").

35
New cards

Input Statement

A statement that takes a string value in from a user (e.g., >>> var = INPUT("please input a value")).

36
New cards

// (Floor / Integer Division)

Integer division that truncates and removes the decimal part of division, rounding down (e.g., 5//2=25 // 2 = 2).

37
New cards

% or MOD

The modulus operator that divides numbers and gives the remainder (e.g., 5%2=15 \% 2 = 1).

38
New cards

Exponent (**)

In Python, an arithmetic operator represented by two asterisks that raises a number to a power (e.g., 3∗∗2=93 ** 2 = 9).

39
New cards

Mouse Event

A user-triggered interaction with a mouse that executes a defined function via a handler (e.g., add_mouse_click_handler(draw_circle)).

40
New cards

Key Event

A user-triggered keyboard press handled by a bound function that checks the key pressed (e.g., event.key == "ArrowUp") via add_key_down_handler.