Python D335 Material Cards- with Answers Verified
100% Correct
computer program
A _____ _____ consists of instructions executing one at a time.
Input: A program gets data, perhaps 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 to a file, screen, or network.
Basic instruction types are:
variables, due to a variable's value "varying" as a program assigns a variable like x with new
values.
Programs use ____ to refer to data, like x, y, and are named references to values stored by the
interpreter.
computational thinking
creating a sequence of instructions to solve a problem is referred as what kind of thinking?
algorithm
A sequence of instructions that solves a problem is called an ______
Python Interpreter
is a computer program that executes code written in the Python programming language.
interactive interpreter
is a program that allows the user to execute one line of code at a time.
code
is a common word for the textual representation of a program
line
,is a row of text.
prompt (">>>")
The interactive interpreter displays a ______ that indicates the interpreter is ready to accept
code.
statement
is a program instruction.
expressions
are code that return a value when evaluated ex wage hours weeks
assignment, = EX salary = wage hours weeks
A new variable is created by performing an _______ using the ____ symbol
print() EX print('Salary is:', salary)
The ______ function displays variables or expression values.
# comments
_____ characters denote _______, which are optional but can be used to explain portions of
code to a human reader.
string literal
Text enclosed in single or double quotes is known as a _________. Text in _______ may have
letters, numbers, spaces, or symbols like @ or #.
new line -print()
Each use of print() starts on a ______.
end=' '
A programmer can add ______ inside of print() to keep the output of a subsequent print
statement on the same line separated by a single space.
,print(variable_name), without quotes around variable_name
The value of a variable can be printed out via: ______
\n newline character Ex: print('1\n2\n3')
Output can be moved to the next line by printing _____ known as a ______.
whitespace
Any space, tab, or newline is called
input()
function is used to read input from a user. causes the program to wait until the user has
entered text and pushed the return key. also receives data as a string type, even numbers
string
is a sequence of characters, like the text "MARY", that can be stored in a variable. can be any
text
type
determines how a value can behave
int
function can be used to convert that string to the integer 123.
string inside the parentheses of input()
Adding a ______ displays a prompt to the user before waiting for input and is a useful shortcut
to adding an additional print statement line.
syntax error
violates a programming language's rules on how symbols can be combined to create a program.
Runtime error
, wherein a program's syntax is correct but the program attempts an impossible operation, such
as dividing by zero or multiplying strings together
crash
Abrupt and unintended termination of a program is often called a _____ of the program.
IndentationError
The lines of the program are not properly indented.
ValueError
An invalid value is used - can occur if giving letters to int().
NameError
The program tries to use a variable that does not exist. If the name cannot be found in any
namespace, the interpreter generates a
TypeError
An operation uses incorrect types - can occur if adding an integer to a string.
logic error or bug
the program would load correctly, but would not behave as intended
IDE (Integrated Development Environment)
Code development is usually done with an
IDLE
is the official Python IDE that is distributed with the installation of Python
PyDev
is a plugin for the popular Eclipse program.
CodePad or Repl
100% Correct
computer program
A _____ _____ consists of instructions executing one at a time.
Input: A program gets data, perhaps 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 to a file, screen, or network.
Basic instruction types are:
variables, due to a variable's value "varying" as a program assigns a variable like x with new
values.
Programs use ____ to refer to data, like x, y, and are named references to values stored by the
interpreter.
computational thinking
creating a sequence of instructions to solve a problem is referred as what kind of thinking?
algorithm
A sequence of instructions that solves a problem is called an ______
Python Interpreter
is a computer program that executes code written in the Python programming language.
interactive interpreter
is a program that allows the user to execute one line of code at a time.
code
is a common word for the textual representation of a program
line
,is a row of text.
prompt (">>>")
The interactive interpreter displays a ______ that indicates the interpreter is ready to accept
code.
statement
is a program instruction.
expressions
are code that return a value when evaluated ex wage hours weeks
assignment, = EX salary = wage hours weeks
A new variable is created by performing an _______ using the ____ symbol
print() EX print('Salary is:', salary)
The ______ function displays variables or expression values.
# comments
_____ characters denote _______, which are optional but can be used to explain portions of
code to a human reader.
string literal
Text enclosed in single or double quotes is known as a _________. Text in _______ may have
letters, numbers, spaces, or symbols like @ or #.
new line -print()
Each use of print() starts on a ______.
end=' '
A programmer can add ______ inside of print() to keep the output of a subsequent print
statement on the same line separated by a single space.
,print(variable_name), without quotes around variable_name
The value of a variable can be printed out via: ______
\n newline character Ex: print('1\n2\n3')
Output can be moved to the next line by printing _____ known as a ______.
whitespace
Any space, tab, or newline is called
input()
function is used to read input from a user. causes the program to wait until the user has
entered text and pushed the return key. also receives data as a string type, even numbers
string
is a sequence of characters, like the text "MARY", that can be stored in a variable. can be any
text
type
determines how a value can behave
int
function can be used to convert that string to the integer 123.
string inside the parentheses of input()
Adding a ______ displays a prompt to the user before waiting for input and is a useful shortcut
to adding an additional print statement line.
syntax error
violates a programming language's rules on how symbols can be combined to create a program.
Runtime error
, wherein a program's syntax is correct but the program attempts an impossible operation, such
as dividing by zero or multiplying strings together
crash
Abrupt and unintended termination of a program is often called a _____ of the program.
IndentationError
The lines of the program are not properly indented.
ValueError
An invalid value is used - can occur if giving letters to int().
NameError
The program tries to use a variable that does not exist. If the name cannot be found in any
namespace, the interpreter generates a
TypeError
An operation uses incorrect types - can occur if adding an integer to a string.
logic error or bug
the program would load correctly, but would not behave as intended
IDE (Integrated Development Environment)
Code development is usually done with an
IDLE
is the official Python IDE that is distributed with the installation of Python
PyDev
is a plugin for the popular Eclipse program.
CodePad or Repl