1. |
_____ represents an entity in the real world with its identity and behavior.
|
||||||||
Answer:
Option (b) |
2. |
_____ is used to create an object.
|
||||||||
Answer:
Option (b) |
3. |
What will be the output of the following Python code?
class test: def __init__(self,a=""Hello World""): self.a=a def display(self): print(self.a) obj=test() obj.display()
|
||||||||
Answer:
Option (c) |
4. |
What is setattr() used for?
|
||||||||
Answer:
Option (b) |
5. |
What is getattr() used for?
|
||||||||
Answer:
Option (a) |
6. |
What is Instantiation in terms of OOP terminology?
|
||||||||
Answer:
Option (d) |
7. |
What will be the output of the following Python code?
class fruits: def __init__(self, price): self.price = price obj=fruits(50) obj.quantity=10 obj.bags=2 print(obj.quantity+len(obj.__dict__))
|
||||||||
Answer:
Option (c) |
8. |
The assignment of more than one function to a particular operator is _______
|
||||||||
Answer:
Option (c) |
9. |
Which of the following is not a class method?
|
||||||||
Answer:
Option (a) |
10. |
Which of the following Python code creates an empty class?
|
||||||||
Answer:
Option (b) |