Compsci 06/101, Spring 2012, January 19
By entering your name/net-id below you indicate you are in class on
January 19 to answer these questions and that you have answered
them. Your name should not appear unless you are in class when
answering
these questions.
Name_________________ net-id _______ Name_________________ net-id _______
Name_________________ net-id _______ Name_________________ net-id _______
- In Python, which of the following is an expression
for how many meters an object falls due to gravity on Earth
when the initial velocity is
velo (m/sec) and
the object falls for sec seconds. More than one
may be correct.
-
velo*sec + 4.9*sec*sec
-
9.8*(sec**2)/2 + sec*velo
-
Math.gravity(velo,sec)
- In Python what is printed when the loop below
executes:
for s in "duke":
print s*2,
- dduukkee
- dukeduke
- error
- In Python, which of the following could be a function
signature for a function with three parameters that
returns the area of a triangle whose sides are given
by the parameters (more than one is possible)
-
def area(a,b,c)
-
def triangle(a,b,c)
-
def tiger_swallowtail(a,b,c)
- What version of Python are we using in class? More than one
can be correct.
- it doesn't really matter
- it's not that important
- 2.7