2.Question 2Which conditional statement prints the message "account locked" when the value of failed_logins is 3 or higher? 1 pointif failed_login_count != 3: print("account locked")if failed_logins >= 3: print("account locked")if failed_login_count == 3: print("account locked")if failed_login_count > 3: print("account locked")
Question
2.Question 2Which conditional statement prints the message "account locked" when the value of failed_logins is 3 or higher? 1 pointif failed_login_count != 3: print("account locked")if failed_logins >= 3: print("account locked")if failed_login_count == 3: print("account locked")if failed_login_count > 3: print("account locked")
Solution
The correct conditional statement is:
if failed_logins >= 3:
print("account locked")
This statement checks if the value of failed_logins is 3 or more. If it is, it prints the message "account locked".
Similar Questions
1.Question 1What will the following code display?ip_address = "192.168.183.51"if ip_address == "192.168.183.51": print("You're logged in.")else: print("Login failed, try again.")1 pointNothing"You're logged in.""Login failed, try again."Both "You're logged in." and "Login failed, try again."
8.Question 8You wrote the following code:if attempts >= 5: print("locked")else: print("try again")If the value in the attempts variable is 3, what will Python do?1 pointOutput the message "try again"First output the message "locked" and then output the message "try again"First output the message "try again" and then output the message "locked"Output the message "locked"
What will be the output after the following statements?x = 60 if x <= 10 or x >= 75: print('True') elif x <= 15 or x >= 55: print('not True') elif x <= 25 or x >= 35: print('False') else: print('not False')OptionsTruenot Truenot FalseFalse
7.Question 7You want to check the string stored in an update_status variable. When it contains a value of "incomplete", you want to print a "schedule update" message. Right now, this conditional statement is not correct. What are the problems with this conditional statement? Select all that apply.if update_status != "incomplete" print("schedule update")1 pointThe line with print("schedule update") should not be indented. The operator should not be !=. It should be ==. There should be quotation marks around the variable update_status. A colon (:) is missing at the end of the conditional header.
Which of the following is the correct syntax for nested if-else in Python?Answer areaif condition1: if condition2: statementif condition1: condition2: statementif condition1: { if condition2: statement }if condition1: [ if condition2: statement ]
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.