Python - Classes and Object Lifecycle
Which of the following is the correct syntax to define a class named
Car?Car?class Car: is correct.def Car(): defines a function, not a class. class Car() is valid syntax but less common; however, it requires a colon at the end. class Car[]: is invalid syntax.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions