Question: You are given a class D og , whose constructor sets the initial values for attributes in the following order: name (string), age (int), type
You are given a class Dog, whose constructor sets the initial values for attributes in the following order:
name (string), age (int), type (string)
Create an instance of Dog, setting the name equal to the string 'Alex', age equal to the integer 4 and the type equal to the string 'Hound'. Assign the newly created object to the variable hound.
this is for python.
Step by Step Solution
3.52 Rating (159 Votes )
There are 3 Steps involved in it
Step 1 Following is the code in python to create a class Dog and s... View full answer
Get step-by-step solutions from verified subject matter experts
