Question: Hi, could you please help me solve this python3 question? Note: this must be in Python Task 1 Create a dog breed class with a
Hi, could you please help me solve this python3 question? Note: this must be in Python
Task 1
Create a dog breed class with a constructor that takes the following:
- Name
- Life expectancy
- Size
- Coat type (limit to long, short, curly, etc.)
- Coat color/pattern
| Class usage | Example output of script |
| gr = Dog("Golden Retriever, 12, "large", "medium", "gold") pg = Dog("Pug", 15, "small", "short","silver fawn") cg = Dog("Corgi", 13, "smol", "fluffy", "tricolor") | This column was left blank,but you can build a class/your own output |
Task2
Write a coin flipping class that inherits from the die class. Bet you never thought of a coin as a two sided die. It would contain the following changes:
- The constructor should not take any arguments as a coin usually only has two sides
- A flip method that uses the roll method. If the roll is 1, return "HEADS". if it is 2, return "TAILS"
| Class usage | Example output of script |
| nickle = Coin() nickle.roll() nickle.flip() idie.roll_multiple() | 1 TAILS [1, 1, 2, 1] |
Thank you!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
