Compsci 101, Fall 2012, August 29, 2012

By entering your name/net-id below you indicate you are in class on August 29 to answer these questions and that you have answered them. Your name should not appear unless you are in class and an active participant in answering these questions.
Name_________________   net-id _______   Name_________________   net-id _______


Name_________________   net-id _______   Name_________________   net-id _______

  1. In Python, what is the type of the value 3.14159?

    1. int

    2. float

    3. list

  2. In Python, what is the value of the expression "123"*2

    1. 456

    2. "123123"

    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. In Python which of the following best describes what a function is?

    1. A name like open or len that does something when it's called.

    2. An abstraction that groups Python code in one place so it can be referred to/called and used by a name.

    3. Something in Python with parameters.