runtime
54 / 500
question 54 Strings & Text · easy

Is this username allowed?

The Runtime Q&A site checks a new username before creating the account. The rules are checked in this order, and the first broken rule is reported: at least 3 characters; at most 15 characters; plain ASCII only (every code point below 128); the first character is a letter a–z or A–Z. Print ok if every rule holds, otherwise the message for the first broken rule.

Inputname, the username
Printstoo short, too long, plain ASCII only, must start with a letter, or ok
Orderthe rules are checked in the order listed, and only the first problem is printed
Examples"codermax39" → ok; "jo" → too short; "9lives" → must start with a letter
Expected output1 line
  1. 1ok

Loading your progress…

Is this username allowed? — Python practice · Runtime