Question

In: Computer Science

PLEASE ANSWER WASNT ANSWERED PYTHON You will ask 3 questions USERNAME = "user1" PASSWORD = "password1"...

PLEASE ANSWER WASNT ANSWERED PYTHON

You will ask 3 questions

USERNAME = "user1"
PASSWORD = "password1"

  1. What is your user name?
  2. What is your password?
  3. What is your age?
    1. If the user name and password are incorrect, display a message that says - Your credentials are not valid
    2. If both user name and password are correct, ask question 3
    3. If the answer to question 3 is eighteen and greater, display a message that says - You're considered an adult
    4. If the answer to question 3 is less than eighteen, display a message that says - you're not considered an adult
    5. MAKE SURE to use the constants above

Solutions

Expert Solution

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:

.


Related Solutions

Python Coding 1. validate_username_password(username, password, users): This function checks if a given username and password matches...
Python Coding 1. validate_username_password(username, password, users): This function checks if a given username and password matches in the stored users dictionary. This function returns True if a match found otherwise returns False. 2. validate_existing_user(users): This function asks for username and password and checks if user provided name and password matches. It prints an informational message and returns username if it does find a match. Call validate_username_password() function to perform this validation. A user has total of three chances to validate....
Create a program (Python) YourFirstnameLastnameA06b.py to ask the user to create a password: The user will...
Create a program (Python) YourFirstnameLastnameA06b.py to ask the user to create a password: The user will first enter a password, then enters the same password again; If the second input is the same as first one, the user successfully creates the password. Print “Well done.”; Otherwise, the user will be directed to repeat the whole process (go to step 1.)
Please define the best practice to storage username / password authentication credentials and specify why? Hint:...
Please define the best practice to storage username / password authentication credentials and specify why? Hint: Since the username is public knowledge, the password storage can be based on.
Please provide answers next to the questions provided. Most questions can be answered with 3 or...
Please provide answers next to the questions provided. Most questions can be answered with 3 or less sentences, but please do not exceed 5 sentences What in your opinion is the biggest reason for information risk? Does auditing eliminate information risk specifically related to your previous answer? Explain your answers . What is the difference between assurance services and non-assurance services that auditing firms can provide? Which category does attestation services belong to (i.e. assurance or non-assurance) and why is...
Please provide answers next to the questions provided. Most questions can be answered with 3 or...
Please provide answers next to the questions provided. Most questions can be answered with 3 or less sentences, but please do not exceed 5 sentences. What is the key difference in the unmodified audit opinion between a public and private company? Provide a fictitious situation that would result in an adverse opinion. Make sure you explain the conditions that exist in your situation that would lead to the adverse opinion and the materiality level.
Please provide answers next to the questions provided. Most questions can be answered with 3 or...
Please provide answers next to the questions provided. Most questions can be answered with 3 or less sentences, but please do not exceed 5 sentences. Do you think the ethical dilemma framework is a useful tool? Why or why not? What is the difference between the appropriateness and the sufficiency of evidence in determining the persuasiveness of evidence. How would you interpret a Gross Profit Percentage of 22%? How would you determine if this number is favorable or unfavorable?
please go to details and don't forget to answer the questions that my professor ask for,...
please go to details and don't forget to answer the questions that my professor ask for, also explain for the first question in one paragraph and explain second question in one paragraph too. thanks. Sex Education and Teenage Pregnancy Santrock (2016) mentions in his text that the United States has one of the highest teenage pregnancy rates of industrialized nations, despite the fact that adolescent sexual activity is no higher in the United States. Why is that? For starters, sex...
Please answer these questions Data Processing and Analysis using python. Thank you In statistics, an outlier...
Please answer these questions Data Processing and Analysis using python. Thank you In statistics, an outlier is a data point that differs significantly from other observations. Outliers can cause serious problems in the analysis of data. Please describe one method that can help you detect outliers in a data set.
Write a Python Version 3 program that will ask you the loan amount and the interest...
Write a Python Version 3 program that will ask you the loan amount and the interest rate. Then the program will tell you - The monthly payment, How many months it will take you to pay off the loan, The total amount of interest paid over the life of the loan. Program should also indicate the final payment as in many cases the final payment at the end of the loan would not be exactly the normal monthly payment and...
Question3: Consider you have the following data for some user accounts: [6 marks] Username Password User1...
Question3: Consider you have the following data for some user accounts: [6 marks] Username Password User1 101010 User2 112121 User3 211211 User4 312132 1. Write a function called validate which takes 2 arguments: a dictionary, a username, and a password. The function should do the following: [3 marks] Find the given username in the dictionary and compare the given password with the one that belongs to that username in the dictionary. Return true if password is correct and false if...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT