1/153
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
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.
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
row of text
prompt
indicates the interpreter is ready to accept code
statement
a program instruction
Expressions
code that return a value when evaluated
cariables
named references to values stored by the interpreter
print()
function that displays variables or expression values
'#"
character tha denote comments, which are optional but can be used to explains portions of code to a human reader
string literal
text enclosed in quotes (single or double) and can contain letters, numbers, spaces, or symbols
Why would a programmer add
end=' ' inside of print()?
To keep the output on the same line
print(variable_name) without quotes
to output the value of a variable
\n
newline character; output can be moved to the next line
whitespace
any space, tab, or newline
variable = input()
reads a user-enter string and changes it into a variable
type
determines how a value can behave
int()
converts a string to an integer
syntax error
violating a programming language's rules on how symbols can be combined to create a program
runtime error
program's syntax is correct, but the program attemps an impossible operation, such as dividing by zero or multiplying strings together
crash
Abrupt and unintended termination of a program
SyntaxError
The program contains invalid code that cannot be understood.
IndentationError
The lines of the program are not properly indented.
ValueError
An invalid value is used- can occur if giving letter to int().
NameError
The program tries to use a variable that does not exist.
TypeError
An operation uses incorrect types - can occur if adding an integer to a string
logic error
An error in a program that makes it do something other than what the programmer intended. (would still load correctly)
A logic error is often called a ______.
bug
integrated development environment (IDE)
Provides a developer with a way to create a program, run the program, and debug the program all within one application.
switch
controls whether or not electricity flows through a wire
Positive voltage is treated as a what in computers?
1
Zero voltage is treated as a what in computers?
0
0s and 1s in are known as what in computers
bits (binary digits)
processors
created to process a list of desired calculations
instruction
a calculation completed by a processor
memory
circuit that can stors 0s and 1s in each of a series of thousands of addressed locations
A ______ computes data.
processor
_________ stores data.
Memory
The programmer-created sequence of instructions is call a _______________ or just an app.
program application
machine instructions
instructions represented as 0s and 1s
excutable program
a sequence of machine instructions together
assembly
language that translate machine instructions into human readable instructions
high-level languages
programming using formulas or algorithms
scripting language
a language tht allows program to be executed withoout compilation
script
a program whose instructions are executed by another program called an interpreter
backward compatible
software feature that enables documents saved in an older version of a program to be opened in a newer version of the program
variable
named item used to hold a value
assignment statement
assigns a variable with a value
identifier (also called a name)
a sequence of letters, underscores, and digits. It must also start with a letter or an underscore
object
represents a value and is automatically created by the interpreter when executing aline of code
garbage collection
Deleting unused objects is an automatic process
Name binding
the process of associating names with interpreter objects
module
a file containing Python code that can be used by other modules or scripts
import
the statement used to make a module availble for use
dot notation
The syntax for calling a function in another module by specifying the module name followed by a dot (period) and the function name.
What is one way you know that a file was executed as a script in Python?
If the value of _name_ is the string '_main_'
function
list of statements that can be executed simply by referring to the function's name
function call
process of invoking a function
argument
item passed to a function
ceil(x)
round up value
factorial(x)
factorial (3! = 3 2 1)
fmod(x, y)
remainder division
fabs(x)
absolute value of x
floor(x)
Round down value
fsum(x)
Floating-point sum of a range, list, or array.
exp(x)
exponential function e^x
pow(x, y)
raise x to power y
log(x, (base))
Natural logarithm; base is optional
sqrt(x)
square root of x
acos(x)
Arc cosine
asin(x)
Arc sine
atan(x)
Arc tangent
atan2(y, x)
Arc tangent with two parameters
cos(x)
cosine
sin(x)
sine
hypot(x1, x2, x3, ..., xn)
Length of vector from origin
degrees(x)
Convert from radians to degrees
radians(x)
convert degrees to radians
tan(x)
tangent
cosh(x)
hyperbolic cosine
sinh(x)
hyperbolic sine
gamma(x)
Gamma function
erf(x)
error function
pi (constant)
Mathematical constant 3.141592...
e (constant)
Mathematical constant 2.718281...
unicode
represent every possible character as a unique number (code point)
\\
Backslash (\)
\'
Single-quote (')
\"
Double-quote (")
\t
tab (indent)
ord()
returns an encoded integer value for a string of length one.
chr()
returns a string of one character for an encoded integer
container
a construct used to group related values together and contains references to other objects intead of data
list
a container created by surrounding a sequence of vaiable or literals with brackets [ ]
element
list item