c Flashcards
What is a program
A program is a computer program that consists of instructions executing one at a time
Input
A program gets 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 that puts data somewhere such as to a file, screen or network.
Variables
Programs use these to refer to data like x
Computational Thinking
creating a sequence of intstructions to solve a problem
Algorithm
a sequence of instructions that solve a problem
Python interperter
A computer program that executes code written in the python language
line
row of text
prompt
the interactive interpreter displays a prompt in whihch indicates the interpreter is ready to acccept the code.
statement
program instruction
Expressions
code that return a value when evaluated
assignment
a new variable is created by performing an assignment using the = symbol
print()
displays variables or expression values
comments
done by which are optional but helps explain the code
string literal
text enclosed in quotes
to keep the output of a print statement on the same line seperated by a space
end = ‘ ‘
to keep the output of a print statement on the same line seperated by a space
end = ‘ ‘
Newline character
\n
whitespace
space,tab, or newline
type
determines how a value can behav
Syntax error
The program contains invalid code that cannot be understood
IndentationError
The lines of the program are not porperly indented
ValueError
Invalid value is used-can occur if giiving lettters to int()
NameError
The program tries to use a vairbale that does not exsist
TypeError
An operation uses incorrect types can occur if adding an integer to string
logic errors
Did not behave as intended so this is also known as a bug
Switchs
controls whether or not the electricity flows through the wire
Bits
binary digits 8 bits in a byte
Processors
process aka execute a list of desired calculations
instructions
each calculation in the processor
memory
Can store a series of thousands of adressed locations, the instructions operate on data as well.
machine instructions
written in 1s and 0s
Executable program
a sequence of machien instructions together to form an executable program