Python sample question with answer 10

Question:
What code displays the data type of the variable username?

  1. username = ["elarson", "bmoreno", "tshah"]
    data_type = type(username)
    print(data_type)
  2. username = ["elarson", "bmoreno", "tshah"]
    data_type = type()
    print(data_type)
  3. username = ["elarson", "bmoreno", "tshah"]
    data_type = username
    print(data_type)
  4. username = ["elarson", "bmoreno", "tshah"]
    type(username) = data_type
    print(data_type)
Answer:
A - is the correct answer. The type() function returns the data type of its input. In this case, that input is the username variable, which contains a list. This data type is assigned to the data_type variable and is displayed through the print() function