Ctrl K

Gamer Tag Check

Easy
A gaming service accepts a player tag tag only if it follows every rule: - it is at least 3 characters long; - it contains only the digits 0–9 and English letters (upper or lower case); - it has at least one vowel; - it has at least one consonant. The vowels are a, e, i, o, u in either case; a consonant is any other English letter. Digits count as neither. Return True if the tag is accepted, and False otherwise.
Example 1
tag="Nova77" → True

Only letters and digits, length 6, with vowels o, a and consonants N, v.

Example 2
tag="x9" → False

Shorter than three characters, and there is no vowel either.

Example 3
tag="ice#42" → False

The # character is not allowed.

Example 4
tag="AE51" → False

There are vowels but not a single consonant.

Constraints
  • 1 ≤ len(tag) ≤ 20
  • tag consists of English letters, digits and the characters @, #, $
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsValue of a Roman Numeral EasyShared Start of Words EasyBracket Balance EasyWhere the Fragment Starts EasyLength of the Final Word Easy
loading Python…
Input
tag="Nova77"
Expected
True

Run checks the first 3 tests in your browser. Submit checks all 7 tests on the server, hidden ones included.