Compsci 101, Fall 2012, September 3
By entering your name/net-id below you indicate you are in class on
September 3 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)
- What is the value of the Python expression below?
"ba"*3 + "na"*2
- error
- bababanana
- bananabananabanana
- bananabanana
- WHatis the value of the Python expression below?
"ba" + 3 * "na" + 2
- error
- bababanana
- bananabananabanana
- bananabanana
- What is the value of the Python 2.7 expression
16 / 7 + 16 % 3
- 2
- 3
- 4
- other
- In Python what is printed when the loop below
executes:
for s in "duke":
print s*3,
- ddduuukkkeee
- dukedukeduke
- error