can you add spaces between terms in code with really changing the meaning - Answers yes
how do u write pi - Answers math.pi
how do you write e - Answers math.e
how do u have access to a module's functionality (ex. math) - Answers import it
aka; import math
if you dont write print you will only see what when you run code - Answers the last output in the
block
how to print something - Answers print( )
how to write a variable - Answers x = 6
can an _ start a variable - Answers yes _x is a valid variable
can some names not be variables - Answers yes, thinks like math and other variables that have other
meanings in python
how to find what type something is - Answers type ( )
what type is just: 1 - Answers intiger
int
what type is: 1.0 - Answers float
what type is 3 + 5.0 - Answers float
what is something put in ' ' - Answers string
str
what is boolean - Answers bool
what is not False - Answers true
what is not not False - Answers false
how do you find string length - Answers len ( )
to print do print ( len ( ) )
what do you do if a string has quotes in it - Answers do ''' '''
looking In things - Answers in
print ( 'H' in 'Hello') - Answers true
format() uses the same funny dot (.) notation. If you have a string with a pair of curly brackets ({}) and
call format, format will replace the curly brackets with whatever is in the parentheses. The Google-
able jargon for this is really bad: "string interpolation" - Answers so it would say whatever variiable is
in it
ex: name = 'deb'
print( 'Hello {}' .format(name) )
print( 'Hello' + ' ' + 'World' )
print( 'comma ' * 3 + 'chameleon') - Answers Hello World
comma comma comma chameleon
how to you test if something is equal - Answers ==
how do you test if something is unequal - Answers !=
how do you make an ordered kind of collection - Answers a list with 2 brackets [ ]
how to retrive something from a list - Answers print ( highways[1])
what number do lists start at - Answers 0
Getting stretches of a list - Answers he slice stops before, not after, the second number
print( even_numbers[0:3] )
.append - Answers add thing to the end of a list
.extend - Answers add a list to the end of a lest
.insert - Answers stick more things into a list