Question
Write a static method named checkGoodString with the following specification. Note that static methods don't have self but must be annotated with @staticmethod. Input parameters:
Write a static method named checkGoodString with the following specification. Note that static methods don't have self but must be annotated with @staticmethod.
Input parameters:
variable named string, type str
Return Value: type bool:
True if string has the following requirements
Is at least 9 characters long
Starts with lower case letter a-z
Contains only one number 0-9
For example,
ret = Assignment2.checkGoodString("f1obar0more") print(ret)
ret = Assignment2.checkGoodString("foobar0more") print(ret)
should print
False
True
I have been strugguling with the part about only 1 number requirement.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started