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

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?
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...
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...
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...
PYTHON Exercise 3. Password locker. 1. You probably have accounts on many different websites. It’s a...
PYTHON Exercise 3. Password locker. 1. You probably have accounts on many different websites. It’s a bad habit to use the same password for each of them because if any of those sites has a security breach, the hackers will learn the password to all of your other accounts. Develop a simple password manager software on your computer where you write the account name (blog, facebook, instagram, etc) as an argument and the password is copied to the clipboard. Then...
PLEASE ANSWER THIS QUESTION WITH THESE VALUES NOT ONE YOU ANSWERED WITH DIFFERENT VALUES!!! THANKS A...
PLEASE ANSWER THIS QUESTION WITH THESE VALUES NOT ONE YOU ANSWERED WITH DIFFERENT VALUES!!! THANKS A radio broadcast antenna is 36.00 km from your house. Suppose an airplane is flying 2.200km above the line connecting the broadcast antenna and your radio, and that waves reflected from the airplane travel 85.00 wavelengths farther than waves that travel directly from the antenna to your house. Part A Do you observe constructive or destructive interference between the direct and reflected waves? (Hint: Does...
This and subsequent questions should be answered in python 3.14 LAB: Detecting Network Change (files and...
This and subsequent questions should be answered in python 3.14 LAB: Detecting Network Change (files and lists) Securing a network from attacks means a network administrator is watching traffic and user activity. Change detection (CD) is a method used to track changes in your network. CD can detect files accessed during off hours to more complex algorithmic detections added to software applications that manage this process. This program is going to manage user login times and attempt to detect any...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT