Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Groups
Community ▾
A
A
Which special method does print(p) call? | StemPy Lab
Quizzes
/
Which special method does print(p) call?
Python Programming
Easy
High School (11–12)
High School (9–10)
Undergraduate
General
Python Going Further › Inheritance and Special Methods
Python Going Further › Classes and Objects
Created by
StemPy Lab
Which special method does print(p) call?
__print__
__text__
__str__
__show__
Check Answer
Log in to save
Tag someone
⚑ Report
← All Quizzes
← A child class overrides a method of its parent. Which version runs for an object of the child?
A class Car has self.engine = Engine(100) in __init__. What is this relation called? →
More on
Python Going Further › Inheritance and Special Methods
Python Going Further › Classes and Objects
Discussion (0)
Log in
to join the discussion.
Loading…
Problems on this topic
For each pair, say whether you would use inheritance (is a) or composition (has a), and why.
Easy
A class Note has an attribute rupees. Write __lt__ and __str__ so that sorted puts a list of notes…
Medium
For each line of code, name the special method that Python calls.
Easy
The loop below works for any animal. Add a class Bird that says Tweet, and a class Parrot built on…
Medium
All problems on this topic →