#K47222. Valid Book Code Checker
Valid Book Code Checker
Valid Book Code Checker
Given a book code as input, determine if it is valid based on the following rules:
- The code must be exactly 8 characters long, i.e. ( |code| = 8 ).
- The first two characters must be uppercase English letters ( [A-Z] ).
- The next four characters must be digits ( [0-9] ).
- The last two characters must be lowercase English letters ( [a-z] ).
For example, the code AB1234cd
is valid while ABC1234d
is not.
Your task is to write a program that reads a book code from standard input and prints True
if the code meets all the rules, or False
otherwise.
inputFormat
The input consists of a single line containing a string that represents the book code.
outputFormat
Print a single line: True
if the input code is valid according to the rules, and False
otherwise.## sample
AB1234cd
True
</p>