Check digits Python First character in string Class CS101 C$191 CS201 CS291 Also
ID: 3757311 • Letter: C
Question
Check digits Python
First character in string Class CS101 C$191 CS201 CS291 Also, the second character lets us know the assignment type. The only valid value for the second character is A, B. C, D, or E. Second character in string Test Program Final Other Requirements . Validate the input is valid (must be 13 characters, valid characters for all characters and imited further for character 1 and 2 Once the user enters an empty string the program will end. Development notes. . Usingupper) will change all the characters to the glven case. Making comparisons is ok for the user to enter it in lower case. We will upper case the value for easier. Break the program down into meaningful functions. Try to solve one problem at a time. Test Values to help in your testing Value ABC BAF189D23ZEA2 Result Incorrect, the value has to be 13 characters in length incorrect, there is an illegal character Z in the value FAF1890234EA2 Incorrect, the first character cannot be F, only A-D B8F189D234EA2 Incorrect, the second character cannot be 8, only A-E BAF189D234EA2 Valid, class is CS191 and assignment is a Test DE2017F000018 Valid, class is CS291 and the assignment is Other Valid, class is CS101 and the assignment is a FinalExplanation / Answer
Save the below code as AssignmentCheckDigits.py
Welcome to the assignment # validator
Enter the assignment number ==> e
The value entered was incorrect
Assignment # must be 13 characters in length
Welcome to the assignment # validator
Enter the assignment number ==> AB123JKLP4JHY
The value entered was incorrect
String contains invalid characters JKLPJHY
Welcome to the assignment # validator
Enter the assignment number ==> BAF199D2343A2
The value given was valid
Assignment BAF199D2343A2 is for class CS191, and is a Test
Welcome to the assignment # validator
Enter the assignment number ==>