Fill This Form To Receive Instant Help
Homework answers / question archive / Suppose that an automated manufacturing tracker records production QC test results in batches in a results string
Suppose that an automated manufacturing tracker records production QC test results in batches in a results string. For example,
Q2p1d1
would indicate that a single batch of two QC tests was performed with the results of one pass and one defect. Note that the character Q is used to start a batch of QC test results. The character p is to identify the number of tests that passed the QC test, and the character d indicates the number of defects. More than one batch of QC test results can be reported in a single results string. For example,
Q2d1p1Q5p3d2
would indicate two batches of QC test results, one with two test results and one with five test results, with a combined total of four passes and three defects.
Precisely, to be a valid QC test results string,
All of the following are examples of valid result strings:
All of the following are examples of invalid result strings:
Your task
For this project, you will implement the following function, using the exact function name, parameter type, and return type shown in this specification. (The parameter and variable names may be different if you wish. Again the function name must be isValidString).
def isString(s):
return isNotString
s is the QC test results string (see above examples of valid and invalid test result strings.)
isNotString is a boolean variable that stores either a True or False value.
This function returns true if its parameter s is a well-formed test result string described above, or false otherwise.
You should include an adequate level of comments in your code to help the code reviewer understand your code.
Save your Python program as QCString.py. Your QCString.py should include the isString() function and other supporting functions that you developed and called from the isString() function. Please remove all output statements (print()) from your functions if you used any output statements like print() to help you to test and debug.
IMPORTANT: You can only use Python built-in functions to write this program. You are not allowed to use any imported modules, packages, or libraries such as pandas, NumPy, math, etc. the goal of this assignment is to practice:
You should be able to complete the assignment with the above-mentioned built-in Python features.
Make sure that you test your function with both valid and invalid test result strings. We will be testing your function with 30 test cases (QC test result strings).