Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a name property for your Dog class. The name must be of type str and between 1 and 2 5 characters . Your _

Define a name property for your Dog class. The name must be of type str and between
1
and
25
characters. Your
_
_
init
_
_
method should receive a default argument for name.
If the name is invalid, the setter method should print
(
)
"Name must be string between
1
and
25
characters."
Define a breed property for your Dog class. Your
_
_
init
_
_
method should receive a default argument for breed.
If the breed is invalid, the setter method should print
(
)
"Breed must be in list of approved breeds." The breed must be in the following list of dog breeds:
approved
_
breeds
=
[
"
Mastiff
"
,
"Chihuahua", "Corgi", "Shar Pei", "Beagle", "French Bulldog", "Pug", "Pointer"
]
FAILED Dog in dog.py prints "Name must be string between 1 and 25 characters." if empty string. - AssertionError: assert 'Name must be...ved breeds.
'== 'Name must be...characters.
'
FAILED Dog in dog.py prints "Name must be string between 1 and 25 characters." if not string. - AssertionError: assert 'Name must be...ved breeds.
'== 'Name must be...characters.
'
FAILED Dog in dog.py prints "Name must be string between 1 and 25 characters." if string over 25 characters. - AssertionError: assert 'Name must be...ved breeds.
'== 'Name must be...characters.
'
FAILED Person in person.py prints "Name must be string between 1 and 25 characters." if empty string. - AssertionError: assert ''== 'Name must be...characters.
'
FAILED Person in person.py prints "Name must be string between 1 and 25 characters." if not string. - AssertionError: assert ''== 'Name must be...characters.
'
FAILED Person in person.py prints "Name must be string between 1 and 25 characters." if string over 25 characters. - AssertionError: assert ''== 'Name must be...characters.
'
FAILED Person in person.py converts name to title case and saves if between 1 and 25 characters - AssertionError: assert 'guido van rossum' == 'Guido Van Rossum'
FAILED Person in person.py prints "Job must be in list of approved jobs." if not in job list. - AssertionError: assert ''== 'Job must be ...roved jobs.
'

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions