Knowee
Questions
Features
Study Tools

What is wrong with the following code?for username in failed_login:print(username)

Question

What is wrong with the following code?for username in failed_login:print(username)

🧐 Not the exact question you are looking for?Go ask a question

Solution

The code you provided seems to be written in Python. However, it's missing proper indentation which is crucial in Python. Here's how it should look:

for username in failed_login:
    print(username)

In Python, blocks of code are defined by their indentation. So, the print(username) statement should be indented to indicate that it's inside the for loop. Without the indentation, you'll get an IndentationError.

This problem has been solved

Similar Questions

4.Question 4Which line of code outputs the string "invalid username" to the screen?1 point# print("invalid username")print("invalid username")print(#invalid username#)print(invalid username)

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."

Write a python program to accept the username "Admin" asthe default argument and password 123 entered by the user toallow login into the system using function

You included username_list[10] in your code, but username_list only contains five elements. What type of error is this?1 分Syntax errorLogic errorExceptionName error

What do these lines print?class User: id = 1u = User()User.id = 98print(u.id)None18998

1/1

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.