Python Basics Quiz
By Mickey Arnold
starstarstarstarstarstarstarstarstarstar
Last updated 10 months ago
5 Questions
1 point
1
Question 1
1.
What is the output?print "Chocolate Chip \nCookies”
What is the output?
print "Chocolate Chip \nCookies”
1 point
1
Question 2
2.
What is the output?print 2**2 * 5
What is the output?
print 2**2 * 5
1 point
1
Question 3
3.
What is the output?name = "Sally"num = 5print ("Tell", name, "that it is", num)
What is the output?
name = "Sally"
num = 5
print ("Tell", name, "that it is", num)
1 point
1
Question 4
4.
What is the output?def area(length, width, height): return length * width * heightprint area(3,4,5)
What is the output?
def area(length, width, height):
return length * width * height
print area(3,4,5)
1 point
1
Question 5
5.
What is the output?class song: def __init__(self, name):
self.name = name def play(self): print "Playing", self.namemySong = song("ABC's")mySong.play()
What is the output?
class song:
def __init__(self, name):
self.name = name
def play(self):
print "Playing", self.name
mySong = song("ABC's")
mySong.play()