Deck 1 Flashcards
#
Comment – anything after this does not get read by computer
print()
Print function. Computer will “speak” the words inside this, as long as there are quotation marks around the words
strings
Blocks of text. Must have either “double” or ‘single’ quotation marks around them. Must be consistent with either double or single all the way through.
variable
Assigns string of data to this using equal sign. Data is stored for later use. Must use quotation marks for strings. this = “the string of data to be stored”
print(this) –outputs– the string of data to be stored
variable rules
Can’t have spaces or symbols other than underscore (_). Cannot begin with number, although can have numbers in it.
reserved words a
and
as
assert
reserved words b
break
reserved words c
class continue
reserved words d
def del
reserved words e
elif
else
except
reserved words f
finally
for
from
reserved words g
global
reserved words i
if
import
in
is
reserved words l
lambda
reserved words n
nonlocal
not
reserved words o
or
reserved words p
pass
reserved words r
raise
return
reserved words t
try
reserved words w
while
with
reserved words y
yield
> > >
interactive chevron prompt. this prompt is the Python interpreter’s way of asking you, “What do you want me to do next?” Python is ready to have a conversation with you.
quit()
the proper way to say “good-bye” to Python. enter at interactive chevron prompt.
script
python file