In: Computer Science
PLEASE ANSWER WASNT ANSWERED PYTHON
You will ask 3 questions
USERNAME = "user1"
PASSWORD = "password1"
username = input("What is your user name? ")
password = input("What is your password? ")
# If the user name and password are incorrect,
if username != "user1" or password != "password1":
print("Your credentials are not valid")
# If both user name and password are correct
else:
age = int(input("What is your age? "))
# If the answer to question 3 is eighteen and greater,
if age >= 18:
print("You're considered an adult")
# If the answer to question 3 is less than eighteen
else:
print("you're not considered an adult")
.
Screenshot:
Output:
.