













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














Logic Error.
An error in a program that makes it do something other than what the programmer intended. It does not prevent the program from running, but causes it to produce incorrect results. Mathematical mistakes are common causes of logic errors.
debugging.
Finding and fixing problems in your algorithm or program.
algorithm.
a set of well-defined logical steps that must be taken to perform a task.
pseudocode.
Shorthand notation for programming which
uses a combination of informal programming structures and verbal descriptions of code.
Flowcharts.
A graphical representation of the steps in a process; details all of the elements in a process and the sequence in which these elements occur. This a tool that programmers use to design programs
terminal symbols.
The ovals that appear at the top and bottom of the flowchart. The start terminal marks the starting point, and the End terminal marks the program's ending point.
input symbol.
indicates an input operation and is represented by a parallelogram in flowcharts
output symbol.
indicates an output operation and is represented by a parallelogram in flowcharts
Flowchart.
a diagram that graphically depicts the steps that take place in a program
Input.
any data that the program receives while it is running.
A function.
is a piece of pre-written code that performs an operation.
Calling a function.
what programmers say when they execute a function.
argument.
the data that you want displayed on the screen
string.
a sequence of characters that is used as data.
string literal.
When a string appears in the actual code of a program.
single or double quotation marks.
In Python, string literals must be enclosed in ________________________
double-quote marks.
If you want a string literal to contain either a single-quote or apostrophe as part of the string, can can enclose the string literal in
triple quotes.
Python also allows you to enclose string literal in ________ __________, why? If the string contains both single- quote marks and double-quote marks.
assignment statement.
You use an ______________________ __________________ to create a variable and make it reference a piece of data.
variable = expression.
assignment statement is written in this general format
assignment operator.
The = sign is know as the
quotation marks.
When you pass a variable as a argument to the print function, you do NOT enclose the variable name in ___________ _____________.
In an assignment statement, the variable that is receiving the assignment must appear on the.
left side of the = operator
You cannot use a variable until you have.
assigned a value to it.
Variable Naming Rules.
garbage collection.
Releases memory that was used for a variable's value once the variable is no longer to be used by a program.
variable reassignment.
to change the value of a variable based on its current value
str.
A Python data type that holds a string of characters. (used for storing strings in memory)
variable.
Keep in mind that in Python, a ___________ is just a name that refers to a piece of data When a program reads data from the keyboard, usually it stores that data in a ___________ so it can be used later by the program (same answer)
nested function calls.
where one function calls another
end.
In a print statement, you can set the _____ argument to a space or empty string to stop the output from advancing to a new line.
an algorithm allows ambiguity.
Which of the following is not true? An algorithm, when carried out, must eventually stop
An algorithm allows ambiguity An algorithm, can be carried out by a human being
logic.
The purpose of testing a program with different combinations of data is to expose run-time and ____ errors.
String constant.
a specific group of characters enclosed within quotation marks
empty string.
A string value that has no characters, represented in code as "".
variable.
A location in memory used for storing data and given a name in a computer program is called a _________ because the data in the location can be changed.
foreground = "red".
Associate the variable foreground with the value "red".
assign a value; it will reference that value until you assign it a different value.
whole number.
A numeric literal that is written as a _____________ ______________ with no decimal point is considered an int
decimal point.
A numeric literal that is written as a ______________ _____________ is considered a float
input function.
reads a piece of data that has been entered at the keyboard and returns that piece of data, as a string, back to the program - you normally us this function in an assignment statement
prompt.
In the general format, _____________ is a string that is displayed on the screen.
exception.
an unexpected error that occurs while a
program is running, causing the program to halt if the error is not properly dealth with.
math operators.
a programmer's tools for performing calculations
Python addition operator that adds two numbers
Python subtraction operator that subtracts one number from another
Python multiplication operator that multiplies on number by another
Python division operator that divides on number by another and gives the result as a floating-point number
line continuation character.
Python allows you to break a statement into multiple lines by using this; which is a backslash ( \ ) You simply type the backslash character (no parentheses) where you want to break the statement, then press the Enter key.
parentheses.
Python also allows you to break any part of a statement that is enclosed in ________________ without using the line continuation character.
newline character.
You can think of this as a special command that causes the computer to start a new line of output (you do not see it, but when it is displayed, it causes the output to advance to the next line)
end=' '.
A keyword parameter for the print() function that causes the function to NOT add a newline at the end of the string. (there is a space between the quotes)
end=''.
A keyword parameter for the print() function that causes the function to NOT add a newline at the end of the string and NOT add a space (there is not space between the quotes.
sep=''.
When multiple arguments are passed to the print function, they are automatically separated by a space when they are displayed on the screen, if you do NOT want a space printed between the items; you can pass this argument to the print function ie: OneTwoThree
sep='*'.
You can also tell this special argument to specify a character other than a space to separate multiple items ie: OneTwoThree (you can use any character)
escape character.
is a special character that is preceded with a backslash ( \ ), appearing inside a string literal, for example: \n
Causes a backslash character to be printed; in Python ie: print('The path is C:\temp\data.') required when you want to print a backslash; a single one will not work in Python.
string concatenation.
This means that when using the plus sign + between string; itappeand one string to another ie: print('This is ' + 'one string.') will print: This is one string. It is useful for breaking up a string literal so a lengthy call to the print function can span multiple lines.
format function.
When you call the built-in format function, you pass two arguments to the function: a numeric value and a format specifier. Python has built-in format function that allow decimal places to be rounded a more. format( )
format specifier.
is a string that contains special characters specifying how the numeric value should be formatted
'.2f'.
A format specifier in Python that prints 2 decimal spaces; you can change the number to any number of decimal spaces
e.
If you prefer to display floating-point numbers in scientific notation, you can use this letter (either capitalized or not) instead of f ie: print(format(12345.6789, 'e')) will print: 1.234568= ie: print(format(12345.6789, '.2e')) will print: 1.23e+
Format specifier Minimum Field Width.
the minimum number of spaces that should be allowed to display the value ie: print('The number is, format(12345.6789, '12.2f))