Valid TikTok emails are of the form user@tiktok.com, and the characteristics of user are: It starts with 1 to 6 lowercase English letters denoted by the character class [a-z]. The lowercase letter(s) are followed by an optional underscore, i.e. zero or one occurrence of the underscore '_' character. The optional underscore is followed by 0 to 4 optional digits denoted by the character class [0-9]. Domain is always tiktok.com. Complete the code in the editor below by replacing the blank () with a regular expression that matches a valid email addresses according to the criteria above.
Asked in the first round technical stage as a HackerRank-style fill-in regex task. Implement is_valid_tiktok_email(email) and return a Boolean. Examples include a@tiktok.com as valid and abcdef_1234@tiktok.com as valid.
@tiktok.comdef is_valid_tiktok_email(email):