ic01 : Review for Final Exam
| num | ready? | description | assigned | due |
|---|---|---|---|---|
| ic01 | true | Review for Final Exam | Wed 09/05 09:30AM | Wed 09/05 10:50AM |
-
Write the definition of a Python function
maskedPasswordthat takes one parameterpasswordand return a string consisting of the first three characters contained in the variablepasswordfollowed by ‘x’s instead of the remaining characters inpassword. The length of the returned value should be the same as the length of the parameter passed in. (YOU MAY ASSUMEpasswordis of typestr) -
Write three test cases (in the style of the
pytestmodule) that for the functionmaskedPasswordas defined above.- Write your one test case here:
- Write a second test case here:
- Write a third test case here:
-
Write the definition of a Python function
isValidPasswordthat takes a parameterpasswordand returns True if the variablepasswordis of typestrand is a valid password, according to the following rules: it must consist of at least 8 characters, include one of the special characters*or#and terminate with a numeric digit (0-9). -
Write three test cases (in the style of the
pytestmodule) that for the functionmaskedPasswordisValidPasswordas defined above.- Write one test case here:
- Write a second test case here:
- Write a third test case here: