#K53777. Valid PIN Checker
Valid PIN Checker
Valid PIN Checker
You are given a string representing a PIN. A valid PIN must satisfy the following conditions:
- It consists only of numeric digits (0–9).
- Its length is exactly 4 or exactly 6.
Your task is to write a program that reads a PIN from standard input and determines whether it is valid. If the PIN is valid, the program should output True
; otherwise, it should output False
.
Note: The input is provided via standard input (stdin) and the output should be printed to standard output (stdout).
Examples:
- Input: "1234" → Output: True
- Input: "123456" → Output: True
- Input: "123" → Output: False
- Input: "12345a" → Output: False
inputFormat
The input consists of a single line containing the PIN as a string. The string may include leading or trailing spaces which should be considered as part of the PIN.
outputFormat
The output is a single line: True
if the PIN is valid according to the criteria, or False
if it is not.
1234
True