#C13769. Validate Special String
Validate Special String
Validate Special String
You are given a string S. Your task is to check whether the string satisfies the following two conditions:
- The string contains exactly three uppercase English letters. In other words, if you let \(C = \{i \mid S[i] \text{ is an uppercase letter}\}\), then \(|C| = 3\).
- The string ends with the digit
7
.
You are required to read the input from stdin
and print either True
or False
to stdout
according to the result. This problem can be solved using regular expressions; note that if you use a regex, any formulas in this description are given in \(\LaTeX\) format.
inputFormat
The input consists of a single line containing the string S.
Note: The input is provided via stdin
.
outputFormat
Output a single line: True
if the string satisfies both conditions, and False
otherwise.
The output should be written to stdout
.
ABCdefg7
True