31. What does the following code do?

read_text = text.read()

  • Reads the string text and stores it the file read_text
  • Splits the text variable, which contains a string, and stores it as a list in read_text
  • Reads the text variable, which contains a file, and stores it as a string in read_text
  • Replaces the contents of the file read_text with the contents of the file text

32. You want to check for unusual login activity. Specifically, you want to check if there were more than three failed login attempts in the last 10 minutes by the last user who logged in. If you want to automate this through Python, what would be part of your code? Select three answers.

  • A for loop that iterates through the list of logins
  • A line of code that reassigns a counter variable to 0 if there is a failed login attempt
  • A counter variable that increments when a failed login is detected
  • An if statement that checks if there were more than three failed login attempts

Leave a Reply