1/43
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
program
Consists of instructions executing one at a time.
Input
A program receives data from a file, keyboard, touchscreen, network, etc.
Process
A program performs computations on that data, such as adding two values like x + y.
Output
A program puts that data somewhere, such as a file, screen, or network.
variables
Used by programs to refer to data, like x.
computational thinking
Creating a sequence of instructions to solve a problem.
algorithm
A sequence of instructions that solves a problem.
Python interpreter
A computer program that executes code written in the Python programming language.
Interactive interpreter
A program that allows the user to execute one line of code at a time.
Code
A common word for the textual representation of a program.
line
A row of text.
prompt
The interactive interpreter displays one of these (">>>") to indicate the interpreter is ready to accept code.
statement
A program instruction.
Expressions
Code that return a value when evaluated.
assignment
A new variable is created by performing an assignment using the = symbol.
comments
Denoted by “#”; are optional but can be used to explain portions of code to a human reader.
print()
The primary way to print output.
string literal
Text enclosed in quotes.
newline
A line break; is output after every print() statement.
newline character
Output can be moved to the next line by printing "\n".
whitespace
Any space, tab, or newline.
input()
Reading input is achieved using this function.
string
The input obtained by input() is any text that a user typed, including numbers, letters, or special characters such as # or @.
type
Strings and integers are each an example of this; determines how a value can behave.
int()
If a string contains only numbers, like '123', then this function can be used to convert that string to the integer 123.
incrementing
Increasing a variable's value by 1, as in x = x + 1.
identifier / name / underscores
A sequence of letters (a-z, A-Z), underscores (_), and digits (0-9), and must start with a letter or an underscore.
case sensitive
Python is this, meaning uppercase and lowercase letters differ. Ex: "Cat" and "cat" are different.
Reserved words / keywords
Words that are part of the language and cannot be used as a programmer-defined name.
PEP 8
Python Enhancement Proposal; outlines the basics of how to write Python code neatly and consistently.
object
Represents a value and is automatically created by the interpreter when executing a line of code. For example, executing x = 4 creates a new object to represent the value 4.
garbage collection
Deleting unused objects is an automatic process called garbage collection that frees memory space.
Name binding
The process of associating names with interpreter objects. An object can have more than one name bound to it, and every name is always bound to exactly one object. Name binding occurs whenever an assignment statement is executed.
Value
A value such as "20", "abcdef", or "55".
Identity
A unique identifier that describes the object.
type()
Built-in function that returns the type of an object.
Mutability
Indicates whether the object's value is allowed to be changed.
immutable
Integers and strings are this; meaning integer and string values cannot be changed.
id()
Built-in function that gives the value of an object's identity.
syntax error
One kind of mistake that violates a programming language's rules on how symbols can be combined to create a program.
runtime error
When a program's syntax is correct but the program attempts an impossible operation, such as dividing by zero or multiplying strings together (like 'Hello' * 'ABC').
crash
Abrupt and unintended termination of a program.
logic error
When the program is logically flawed.
bug
A logic error is often called this.