Menu

Input Validation - Code Quiz

1. Which type of validation check does this code implement?

username = input('Enter your username: ') while username == '': username = input('Enter your username: ') print('Hello', username)
Range check
Length check
Pattern check
Presence check

2. The user enters AB12. What is output?

code = input('Enter code: ') if code.isalpha(): print('Accepted') else: print('Rejected')
Rejected
True
Accepted
Error

Log in or sign-up to access the quiz



Don't have a login?

You can still revise this topic