Question

    Predict the output

    list1 = ['physics', 'chemistry', 1997, 2000]

    list2 = [1, 2, 3, 4, 5, 6, 7 ]

    print "list1[0]: ", list1[0]          

    A list1[1]: physics Correct Answer Incorrect Answer
    B list1[2]: physics Correct Answer Incorrect Answer
    C list1[0]: physics Correct Answer Incorrect Answer
    D None Correct Answer Incorrect Answer

    Solution

    1. List Definitions :
      • list1 is a list containing the elements ['physics', 'chemistry', 1997, 2000].
      • list2 is a list containing the elements [1, 2, 3, 4, 5, 6, 7].
    2. Print Statement :
      • The print statement is intended to display the value at list1[0].
    Output Explanation
    • list1[0] refers to the first element in list1, which is 'physics'.

    Practice Next