exam 1 Flashcards
A program receives data from a file, keyboard, touchscreen, network, etc.
Input
A program performs computations on that data, such as adding two values like x + y.
Process
A program puts that data somewhere, such as a file, screen, or network.
Output
A sequence of instructions that solves a problem
algorithm
A common way to become familiar with algorithms
turtle graphics
a program that allows the user to execute one line of code at a time.
interactive interpreter
a computer program that executes code written in the Python programming language.
Python interpreter
a common word for the textual representation of a program
Code
a row of text.
line
what is “»>” called?
prompt
a program instruction. A program mostly consists of a series of statements, and each statement usually appears on its own line.
statement
are code that return a value when evaluated
Expressions
A new variable is created by performing an _____ using the “=” symbol
assignment
function displays variables or expression values.
print()
Characters such as “#” denote
comments
Text enclosed in quotes is known as a ____. May have letters, numbers, spaces, or symbols like @ or #.
string literal
keeps the output of a subsequent print statement on the same line separated by a single space
end=’ ‘
Output can be moved to the next line by printing __ , known as a _______ .
“\n” , newline character
Any space, tab, or newline is called
whitespace
The function ______ causes the interpreter to wait until the user has entered text and pushed the return key.
input()
The input obtained by input() is any text that a user typed, including numbers, letters, or special characters such as # or @. Such text in a computer program is called a ____.
string
a ____ determines how a value can behave
type
violates a programming language’s rules on how symbols can be combined to create a program.
syntax error
a program’s syntax is correct but the program attempts an impossible operation
runtime error
Abrupt and unintended termination of a program is often called a
crash
The lines of the program are not properly indented.
Indentation Error
An invalid value is used, which can occur if giving letters to int().
Value Error
The program tries to use a variable that does not exist.
Name Error
An operation uses incorrect types, which can occur if adding an integer to a string.
Type Error
The program would load correctly but would not behave as intended. Such an error is known as a _______, because the program is logically flawed.
logic error
A logic error is often called a ___.
bug
An _________ assigns a variable with a value
assignment statement
a ____ is a named item
variable
Increasing a variable’s value by 1, as in x = x + 1, is common and known as_____ the variable.
incrementing
An ____, also called a name, is a sequence of letters (a-z, A-Z), underscores (_), and digits (0–9), and must start with a letter or an underscore.
identifier
______, or keywords, are words that are part of the language and cannot be used as a programmer-defined name.
Reserved words
outlines the basics of how to write Python code neatly and consistently
Python Enhancement Proposal (PEP 8)
A __________number is a real number. The term refers to the decimal point appearing anywhere in the number.
floating-point
is a data type for floating-point numbers.
float
A _____ is written with the fractional part even if that fraction is 0.
floating-point literal
A floating-point literal using ____ is written using an “e” preceding the power-of-10 exponent.
scientific notation
Assigning a floating-point value outside of this range generates an _____.
Overflow Error
occurs when a value is too large to be stored in the memory allocated by the interpreter.
Overflow
A ____ is a specific value in code
literal
An ____ is a symbol that performs a built-in calculation
operator
what is the exponent operator and in terms of x and y?
**, x to the power of y