136k views
1 vote
QUICK PLEASE!!!!!! 100 POITNS

Which line of code will have "navy rainbow" as an output?
class pencil:
color = 'yellow'
hardness = 2
class pencilCase:
def __init__(self, color, art):
self.color = color
self.art = art
def __str__(self):
return self.color + " " + self.art
# main program
pencilA = pencil()


print (caseA)

QUICK PLEASE!!!!!! 100 POITNS Which line of code will have "navy rainbow&quot-example-1
User Voldy
by
7.0k points

1 Answer

2 votes

Answer: (A) -> caseA.pencilCase(’navy’, ‘rainbow')

Step-by-step explanation:

I believe that you may have written an error on the second to last line of your code, instead of setting:

pencilA = pencil() --> this should be: caseA = pencil()

which makes A the correct answer!

User Kwan
by
7.0k points