Menu
Coddy logo textTech

Recap - Validation Function

Part of the Fundamentals section of Coddy's Python journey — lesson 47 of 77.

challenge icon

Challenge

Easy

Write a function named is_valid that gets two strings arguments, username and password.

The function will return True if the username and password are valid in the system, otherwise False.

Our system contains only two valid usernames - "admin" and "user".

The valid password for username "user" is "qweasd".

For username "admin" any password is valid!

Note: Do not call the function — we will test it automatically.

Try it yourself

def is_valid(username, password):
    # Write code here

All lessons in Fundamentals