Python Basics: Building Systems With Classes (Quiz)
![Avatar image for Bartosz Zaczyński](/cdn-cgi/image/width=500,height=500,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/coders_lab_2109368.259b1599fbee.jpg)
Bartosz Zaczyński RP Team on Nov. 4, 2023
It does return True
, and that’s what the quiz question expects. Are you getting a different result when you run the code?
Lilian Cipciriuc on Jan. 24, 2025
Running the code
bobo = JackRusselTerrier()
is throwing a syntax error
![Avatar image for Bartosz Zaczyński](/cdn-cgi/image/width=500,height=500,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/coders_lab_2109368.259b1599fbee.jpg)
Bartosz Zaczyński RP Team on Jan. 27, 2025
@Lilian Cipciriuc If you’re seeing a syntax error, then it must be caused by an earlier piece of code because the line that you posted appears to be synactically correct. The error’s stack trace should point you in the right direction, though, as it usually includes the offending line of code.
Here’s an example:
>>> def function
File "<python-input-0>", line 1
def function
^
SyntaxError: expected '('
Become a Member to join the conversation.
CB on Nov. 3, 2023
Unsure why
isinstance(jack, Dog)
returnsFalse
.jack
is in theBulldog
class which is a subclass ofDog
, so should returnTrue
?