Compsci 101, Spring 2012, First Day
By entering your name/net-id below you indicate you are in class on
January 12 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 the session of Python done in the browser
using the tool from skulpt.org what
is the name of the function being run?
-
test
-
name
-
def
- What's the best way to change the program shown so that
it prints
Hello Jello
- Change the call to
test("Jello")
- Change the print statement to
print "Hello Jello"
- replace the entire browser window with one statement
print
"Hello Jello"
- We'd like to change the function
test so that
it can print messages like "Hello pretty leopard", "Hello slimy toad",
"Hello giant panda", i.e., so that a Hello greeting is printed
an animal with an adjective so that both can be changed easily. What
should be done?