Python Programming - Classes - Discussion
Discussion Forum : Classes - General Questions (Q.No. 44)
44.
Consider the following Python code:
class Animal:
def __init__(self, species):
self.species = species
# Create an instance of the Animal class
my_animal = Animal("Lion")
# What does the 'my_animal.species' represent?
Answer: Option
Explanation:
'my_animal.species' represents the specific species attribute of the individual animal object.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers