#K78912. Username Validator
Username Validator
Username Validator
You are given a username as a string. Your task is to determine whether it is valid based on the following rules:
- The username must have a length between 5 and 20 characters, inclusive.
- The username can only consist of lowercase letters (a–z), digits (0–9), and underscores (
_
). - The username must start with a lowercase letter.
For each username provided, print True
if it is valid, or False
otherwise.
inputFormat
The first line contains an integer T, the number of test cases.
Each of the following T lines contains a single string denoting a username.
outputFormat
For each test case, output a single line containing either True
if the username is valid or False
if it is not.
3
cool_user_123
UserCool_123
short
True
False
True
</p>