What this deck covers
This deck focuses on Variables And Assignments, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science Principles.
Study Variables And Assignments in AP Computer Science Principles with focused flashcards that help you recognize the idea, recall the key rule, and apply it in practice-style prompts.
0% Complete
Which statement defines a variable in Python?
Tap card or press Space to flip
x = 10. Python uses simple assignment without type keywords.
How well did you know it?
Card 1 / 70
Space to flip · ← / → to move · once flipped, → Got it · ← Still learning
This deck focuses on Variables And Assignments, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science Principles.
Work through these flashcards in short sessions. Try to answer each prompt before flipping the card, then revisit any cards you miss until the explanation feels automatic.
Answer: x = 10. Python uses simple assignment without type keywords.
Answer: int. Integer division truncates decimal portion.
Answer:
Answer: Assigns "John" to the variable name. String variable declaration and initialization.
Answer: A variable with a fixed value. Constants cannot be modified after initialization.
Answer:
Answer: A named storage location for data. Variables store values that can change during program execution.
Answer: int. Integer division truncates decimal portion.
Answer: Local to that function. Function variables exist only within that function.
Answer:
Answer: var, let, or const. JavaScript variable declaration keywords.
Answer: A named storage location for data. Variables store values that can change during program execution.
Answer: Incorrect type; use int x; x = 0;. String value cannot be assigned to int type.
Answer: Arithmetic error. Division by zero is mathematically undefined.
Answer: Assigning an initial value to a variable. Setting a variable's first value.
Answer: Boolean. Boolean stores only true or false values.
Answer: _name, name. Variable names cannot start with digits.
Answer: Use decimal point: double price = 9.99;. Use period, not comma, for decimal separator.
Answer: Incorrect type; use int x = 3;. Single quotes denote characters, not integers.
Answer:
Answer: x = 5;. Proper assignment syntax with equals operator.
Answer: Incorrect type; use int x; x = 0;. String value cannot be assigned to int type.
Answer: No assigned object or value. Indicates absence of any object reference.
Answer:
Answer: To specify a variable's type and name. Establishes variable name and data type.
Answer: Joining two strings together. String concatenation combines text values.
Answer: Array or List. Data structures for multiple related values.
Answer: Declares and initializes x and y. Multiple variable declaration in one statement.
Answer: char. Stores single Unicode characters.
Answer: 1.5. Double division produces decimal result.
Answer: _name, name. Variable names cannot start with digits.
Answer: Decreases x by 5. Compound subtraction assignment operator.
Answer: Array or List. Data structures for multiple related values.
Answer: Incorrect type; use int x = 3;. Single quotes denote characters, not integers.
Answer: The equals sign (=). Assignment operator stores values in variables.
Answer: The equals sign (=). Assignment operator stores values in variables.
Answer:
Answer: Syntax error; use double y = 5.5;. Double decimal point makes number invalid.
Answer: Arithmetic error. Division by zero is mathematically undefined.
Answer: char. Stores single Unicode characters.
Answer: Increments x by 1. Common pattern for incrementing counters.
Answer: No assigned object or value. Indicates absence of any object reference.
Answer: Assigns "John" to the variable name. String variable declaration and initialization.
Answer:
Answer: Overflow occurs. Values wrap around when exceeding maximum range.
Answer: Increments x to 6. Pre-increment operator adds one before use.
Answer: 'int' is for integers; 'double' is for decimals. Different data types for whole vs decimal numbers.
Answer: Decreases x by 5. Compound subtraction assignment operator.
Answer: Overflow occurs. Values wrap around when exceeding maximum range.
Answer: Declares and initializes x and y. Multiple variable declaration in one statement.
Answer:
Answer: Increments x to 6. Pre-increment operator adds one before use.
Answer: A variable with a fixed value. Constants cannot be modified after initialization.
Answer:
Answer: 1.5. Double division produces decimal result.
Answer:
Answer:
Answer: Use decimal point: double price = 9.99;. Use period, not comma, for decimal separator.
Answer: 'int' is for integers; 'double' is for decimals. Different data types for whole vs decimal numbers.
Answer:
Answer: To specify a variable's type and name. Establishes variable name and data type.
Answer: Syntax error; use double y = 5.5;. Double decimal point makes number invalid.
Answer: Boolean. Boolean stores only true or false values.
Answer: Local to that function. Function variables exist only within that function.
Answer: Increments x by 1. Common pattern for incrementing counters.
Answer: Joining two strings together. String concatenation combines text values.
Answer: x = 5;. Proper assignment syntax with equals operator.
Answer: var, let, or const. JavaScript variable declaration keywords.
Answer: Assigning an initial value to a variable. Setting a variable's first value.
Answer: x = 10. Python uses simple assignment without type keywords.