UPDATED | WITH COMPLETE SOLUTION
Can you add spaces between terms in code with really changing the meaning -
ANSWER-yes
How do u write pi - ANSWER-math. pi
How do you write e - ANSWER-math. e
How do u have access to a module's functionality (ex. math) - ANSWER-import it
aka; import math
If you don’t write print, you will only see what when you run code - ANSWERthe
last output in the block
How to print something - ANSWER-print ()
How to write a variable - ANSWER-x = 6
Can an _ start a variable - ANSWER-yes _x is a valid variable
Can some names not be variables - ANSWER-yes, thinks like math and other
variables that have other meanings in python
How to find what type something is - ANSWER-type ()
What type is just: 1 - ANSWER-intiger int
What type is: 1.0 - ANSWER-float
What type is 3 + 5.0 - ANSWER-float
What is something put in ' ' - ANSWER-string str
,What is Boolean - ANSWER-bool
What is not False - ANSWER-true
What is not False - ANSWER-false
How do you find string length - ANSWER-len () to
print do print (len ())
What do you do if a string has quotes in it - ANSWER-do ''' '''
Looking In things - ANSWER-in
Print ('H' in 'Hello') - ANSWER-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" - ANSWER-so it would say whatever variable is in it
ex: name = 'deb'
Print ('Hello {}’. format (name))
Pint ('Hello' + ' ' + 'World')
Print ('comma ' * 3 + 'chameleon') - ANSWER-Hello World comma
comma comma chameleon
How to you test if something is equal - ANSWER-==
How do you test if something is unequal - ANSWER-! =
How do you make an ordered kind of collection - ANSWER-a list with 2 brackets [
]
How to retrieve something from a list - ANSWER-print (highways [1])
, What number do lists start at - ANSWER-0
Getting stretches of a list - ANSWER-he slice stops before, not after, the second
number
Print (even numbers [0:3])
. append - ANSWER-add thing to the end of a list
. extend - ANSWER-add a list to the end of a lest
. insert - ANSWER-stick more things into a list
CMN 150V
Problems of simplicity - ANSWER-2 variable problems simple
Problems of averages - ANSWER- ▪
probability
▪ many variables
▪ air molecules
▪ Law of Large Numbers
Law of Large Numbers - ANSWER-gives us distribution height
NEW: problems of organization /complexity - ANSWER-dealing with problems
as a system/whole solution: computational science comes out of war time
development especially applicable to problems in social science because they
are not simple (more than 2 variables, and hard to build averages because of
diversity)
Which science is the most complex? - ANSWER-Social Science
What is the limitation of data - ANSWER-can only tell us what happened in the
past