Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

What does polymorphism mean in OOP?

View

Which of the following is an example of polymorphism?

View

What is the difference between method overriding and method overloading?

View

Which operator is overloaded when we use + with two strings?

View

Which method is used to compare objects using ==?

View

Can polymorphism exist without inheritance?

View

Which of the following correctly describes duck typing in Python?

View

How does Python achieve method overloading?

View

Which of the following is true about operator overloading?

View

What is the output of print(2 * 'A')?

View

What does polymorphism mean in OOP?

The ability to inherit methods
The ability to take many forms
Hiding data from users
Creating new classes

Which of the following is an example of polymorphism?

Method overriding
Method overloading
Operator overloading
All of the above

What is the difference between method overriding and method overloading?

Overriding happens within the same class, overloading in child classes
Overloading happens within the same class, overriding in child classes
Both occur in the same way
None of the above

Which operator is overloaded when we use + with two strings?

__str__()
__add__()
__mul__()
__concat__()

Which method is used to compare objects using ==?

__eq__()
__cmp__()
__compare__()
__is__()

Can polymorphism exist without inheritance?

Yes, through method overloading
No, it requires inheritance
Yes, through operator overloading
Both a and c

Which of the following correctly describes duck typing in Python?

If it looks like a duck and quacks like a duck, it is a duck
Strict type checking during compilation
Only classes with the same name can coexist
Inheritance is mandatory

How does Python achieve method overloading?

By defining multiple methods with the same name
By using default arguments
By using abstract methods
Python does not support method overloading directly

Which of the following is true about operator overloading?

Operators cannot be redefined
Operators can be overloaded using special methods
Only numeric operators can be overloaded
Overloading must use __new__()

What is the output of print(2 * 'A')?

AA
A2
Error
AAAA