Write a Python program to implement the New User Registration:
i. Prompt the user, who is doing registration, for entering a username and check its validity.
ii. A valid username must be a string of length 8-12 and consists of:
– at least 3 and at most 8 letters (a-z, A-Z)
– at least 2 and at most 6 digits (0-9)
– at most 1 underscore (_)
iii. Prompt the user for entering a password and check its validity.
iv. A valid password must be a string of length 10-16 and consist of:
– at least one lowercase letter (a-z)
– at least one uppercase letter (A-Z)
– at least one digit (0-9)
– at least one special character (@, #, %, &, $)
v. If the username or password is not valid, inform the user of the specific requirements it does not fulfill (e.g., “A valid password must contain 10-16 characters”, “A valid username must consist of at most 6 digits (0-9)”).
vi. Prompt again and again until a valid username and a valid password are entered.