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 _______

  1. 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.

    1. velo*sec + 4.9*sec*sec

    2. 9.8*(sec**2)/2 + sec*velo

    3. Math.gravity(velo,sec)

  2. In Python what is printed when the loop below executes:
      for s in "duke":
         print s*2,
    
    

    1. dduukkee

    2. dukeduke

    3. error

  3. 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)

    1. def area(a,b,c)

    2. def triangle(a,b,c)

    3. def tiger_swallowtail(a,b,c)

  4. What version of Python are we using in class? More than one can be correct.

    1. it doesn't really matter

    2. it's not that important

    3. 2.7