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