[
{
"term": "Sequence",
"definition": "A set of instructions executed in order from top to bottom. An error in one line stops later steps."
},
{
"term": "Conditional (if)",
"definition": "Executes a block of code only if a specified condition is true."
},
{
"term": "Repetition (Loop)",
"definition": "Repeats a task a fixed number of times or until a condition is met."
},
{
"term": "Function (Named Action)",
"definition": "A group of instructions that performs a specific task; defined once and called when needed."
},
{
"term": "Pseudocode",
"definition": "An informal, language-agnostic description of the steps to solve a problem."
},
{
"term": "Algorithm",
"definition": "A step-by-step procedure to solve a problem; often described with pseudocode or flowcharts."
},
{
"term": "Good Algorithm Qualities",
"definition": "Unambiguous, executable, terminating, and correct."
},
{
"term": "Statement",
"definition": "A single instruction in a program or pseudocode."
},
{
"term": "Program",
"definition": "A sequence of statements executed to perform a task."
},
{
"term": "Execute",
"definition": "To run or carry out the instructions in a program."
},
{
"term": "Keyword",
"definition": "A reserved word in a programming language with a special meaning (e.g., if, else)."
},
{
"term": "Variable",
"definition": "A named storage for a value that can change during execution."
},
{
"term": "Variable Naming Rules",
"definition": "Names can include letters, numbers, and underscores; cannot start with a number or be a keyword."
},
{
"term": "Expression",
"definition": "A combination of values, variables, and operators that evaluates to a new value."
},
{
"term": "Comment",
"definition": "A note in code (prefixed with '#' in Python) that is ignored by the interpreter."
},
{
"term": "Syntax",
"definition": "The set of rules that defines the structure of valid code in a programming language."
},
{
"term": "Constant",
"definition": "A variable intended not to change, usually written in all caps (e.g., INCHES_PER_FOOT)."
},
{
"term": "Operators",
"definition": "Symbols for arithmetic and logical operations (e.g., +, -, , /, %, //, *)."
},
{
"term": "Floor Division (//)",
"definition": "Division that returns the integer part of the quotient (result may be float if an operand is float)."
},
{
"term": "String Literal",
"definition": "Text enclosed in quotes representing a string."
},
{
"term": "String Multiplication",
"definition": "Repeats a string a specified number of times (e.g., 'abc' * 3 → 'abcabcabc')."
},
{
"term": "Print()",
"definition": "Outputs one or more values. Commas add spaces automatically between items."
},
{
"term": "Type()",
"definition": "Returns the data type (class) of a given value."
},
{
"term": "Input()",
"definition": "Prompts the user for input; the returned value is always a string."
},
{
"term": "Type Casting",
"definition": "Converting a value from one type to another (e.g., int('7'), float('7.0'), str(7))."
},
{
"term": "Syntax Error",
"definition": "An error caused by code that violates the programming language's grammar."
},
{
"term": "Runtime Error",
"definition": "An error that occurs during execution (e.g., division by zero, using an undefined variable)."
},
{
"term": "Logical Error",
"definition": "An error where the program runs without crashing but produces incorrect output."
},
{
"term": "String Indexing",
"definition": "Accessing individual characters in a string using indices; index 0 is the first, -1 is the last."
},
{
"term": "String Slicing",
"definition": "Extracting a substring using s[start:end] or s[start🔚step] (start is inclusive, end is exclusive)."
},
{
"term": "List",
"definition": "A mutable, ordered collection of items defined with square brackets []."
},
{
"term": "Tuple",
"definition": "An immutable, ordered collection of items defined with parentheses ()."
},
{
"term": "Dictionary",
"definition": "A collection of key-value pairs enclosed in curly braces {}."
},
{
"term": "Comparison Operators",
"definition": "Operators such as <, >, <=, >=, ==, != that compare values and return Boolean results."
},
{
"term": "Boolean",
"definition": "A data type representing True or False."
},
{
"term": "Boolean Operators",
"definition": "Logical operators (and, or, not) used to combine Boolean expressions."
},
{
"term": "Truthy/Falsy",
"definition": "Values that evaluate to True or False in Boolean contexts (e.g., 0, '', [], (), None are falsy)."
},
{
"term": "Conditional Statement",
"definition": "Uses if, elif, and else to execute code based on whether conditions are true."
},
{
"term": "Nested Conditionals",
"definition": "Conditional statements placed inside another conditional block."
},
{
"term": "Modulus Operator (%)",
"definition": "Returns the remainder of a division operation; useful for checking divisibility."
},
{
"term": "In Operator",
"definition": "Checks whether an element exists within a collection; returns True or False."
},
{
"term": "Last Index in Sequence",
"definition": "Always -1, referring to the final element in a sequence."
},
{
"term": "Slicing Example",
"definition": "\"This should be easy\"[5:11] yields \"should\"."
},
{
"term": "Test: Are strings immutable?",
"definition": "Yes. Strings cannot be changed after creation; modifications require creating a new string."
},
{
"term": "Test: Can you modify a string in place?",
"definition": "No. Assigning a new value to an index (e.g., s[0] = 'H') raises an error."
},
{
"term": "Test: What is s[1:4] for s = 'hello'?",
"definition": "It returns 'ell' (indexes 1 to 3; end index is exclusive)."
},
{
"term": "Test: How do negative indices work?",
"definition": "They count from the end; s[-1] is the last element, s[-2] is the second-last, etc."
},
{
"term": "Test: What does s[::2] do?",
"definition": "Returns every second element of the sequence."
},
{
"term": "Test: What error occurs if you use an undefined variable?",
"definition": "NameError is raised when a variable is used before it is defined."
},
{
"term": "Test: How do you check if an element is in a list?",
"definition": "Use the 'in' operator (e.g., item in list)."
},
{
"term": "Test: What are common falsy values in Python?",
"definition": "0, '', [], (), {}, and None."
},
{
"term": "Test: What does the modulus operator (%) return?",
"definition": "It returns the remainder of a division operation."
},
{
"term": "Test: Can tuples be modified?",
"definition": "No. Tuples are immutable; operations like concatenation create a new tuple."
},
{
"term": "Test: What is floor division?",
"definition": "Division using // that returns the integer part of the quotient (or float if any operand is a float)."
},
{
"term": "Test: How do you convert a string to an integer?",
"definition": "Use int(), provided the string represents a valid integer."
}
]
[
{
"term": "Sequence",
"definition": "A set of instructions executed one at a time, from top to bottom. An error in one line can halt subsequent execution."
},
{
"term": "Conditional (if)",
"definition": "Executes a block of code only if a specified condition is true."
},
{
"term": "Repetition (Loop)",
"definition": "Repeats a task a fixed number of times or until a condition becomes true."
},
{
"term": "Function (Named Action)",
"definition": "A group of instructions that performs a specific task; defined once and called as needed."
},
{
"term": "Pseudocode",
"definition": "An informal, language-agnostic description of steps to solve a problem, useful for planning algorithms."
},
{
"term": "Algorithm",
"definition": "A step-by-step procedure to solve a problem; often described using pseudocode or flowcharts."
},
{
"term": "Good Algorithm: Unambiguous",
"definition": "Instructions are clear and precise, leaving no room for misinterpretation."
},
{
"term": "Good Algorithm: Executable",
"definition": "Every step can be carried out in practice by a computer."
},
{
"term": "Good Algorithm: Terminating",
"definition": "The algorithm eventually ends after a finite number of steps."
},
{
"term": "Good Algorithm: Correct",
"definition": "Produces the right answer for all valid inputs."
},
{
"term": "Statement",
"definition": "A single action or instruction in a program or pseudocode."
},
{
"term": "Program",
"definition": "A sequence of statements that are executed to perform a task."
},
{
"term": "Execute",
"definition": "To run or carry out the instructions in a program."
},
{
"term": "Keyword",
"definition": "A reserved word in a programming language (e.g., if, else, for) that has a special meaning."
},
{
"term": "Variable",
"definition": "A named storage for a value that can change during program execution."
},
{
"term": "Variable Naming Rules",
"definition": "Variable names can include letters, numbers, and underscores but must not start with a number or be a keyword."
},
{
"term": "Expression",
"definition": "A combination of values, variables, and operators that produces a new value."
},
{
"term": "Comment",
"definition": "A note for programmers that is ignored by the interpreter; in Python, starts with '#'."
},
{
"term": "Syntax",
"definition": "The set of rules that defines the structure and format of valid code in a programming language."
},
{
"term": "Variable Declaration",
"definition": "Assigning a value to a variable using the '=' operator (e.g., x = 5)."
},
{
"term": "Constant",
"definition": "A variable intended not to change, often written in all caps (e.g., INCHES_PER_FOOT = 12)."
},
{
"term": "Operators",
"definition": "Symbols for arithmetic operations such as +, -, , /, //, %, and *."
},
{
"term": "Floor Division (//)",
"definition": "Divides and returns the integer part of the quotient; result may be a float if any operand is a float."
},
{
"term": "String Literal",
"definition": "A sequence of characters enclosed in quotes (single or double)."
},
{
"term": "String Multiplication",
"definition": "Repeats a string when multiplied by an integer (e.g., 'abc' * 3 yields 'abcabcabc')."
},
{
"term": "Print()",
"definition": "A function that outputs values; when printing multiple items with commas, spaces are added automatically."
},
{
"term": "Type()",
"definition": "A function that returns the data type of a given value."
},
{
"term": "Input()",
"definition": "Prompts the user for input and always returns a string."
},
{
"term": "Type Casting",
"definition": "Converting a value from one type to another (e.g., int('7'), str(7), float('7.0'))."
},
{
"term": "Type Casting Order",
"definition": "If a string represents a float and you need an integer, first cast to float, then to int."
},
{
"term": "Syntax Error",
"definition": "An error caused by code that violates the language's rules."
},
{
"term": "Runtime Error",
"definition": "An error that occurs during program execution (e.g., division by zero, undefined variables)."
},
{
"term": "Logical Error",
"definition": "An error where the program runs without crashing but produces incorrect results."
},
{
"term": "String Indexing",
"definition": "Accessing individual characters in a string using indices; index 0 is the first character, -1 is the last."
},
{
"term": "String Slicing",
"definition": "Extracting a substring using the notation s[start:end] or s[start🔚step]."
},
{
"term": "List",
"definition": "A mutable, ordered collection of items defined with square brackets []."
},
{
"term": "Tuple",
"definition": "An immutable, ordered collection of items defined with parentheses ()."
},
{
"term": "Dictionary",
"definition": "A collection of key-value pairs enclosed in curly braces {}."
},
{
"term": "Comparison Operators",
"definition": "Operators such as <, >, <=, >=, ==, and != that compare values and return a Boolean result."
},
{
"term": "Boolean",
"definition": "A data type that represents True or False."
},
{
"term": "Boolean Operators",
"definition": "Logical operators (and, or, not) that combine Boolean expressions."
},
{
"term": "Truthy/Falsy",
"definition": "Values that evaluate to True or False in Boolean contexts; e.g., 0, '', [], (), and None are falsy."
},
{
"term": "Conditional Statement",
"definition": "A control structure using if, elif, and else to execute code based on conditions."
},
{
"term": "Nested Conditionals",
"definition": "Conditional statements placed within another conditional block."
},
{
"term": "Modulus Operator (%)",
"definition": "Returns the remainder of a division operation; useful for checking divisibility."
},
{
"term": "In Operator",
"definition": "Tests whether an element exists within a collection; returns True or False."
},
{
"term": "Last Index in Sequence",
"definition": "Always -1, which refers to the final element of a sequence."
},
{
"term": "Slicing Example",
"definition": "\"This should be easy\"[5:11] yields \"should\"."
}
]