📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    What will be the output of the following Python

    code: a=[1,2,3,4,5,6] print(a[-1],a[-1:],a[:-1])
    A [6] [6] [1,2,3,4,5,6] Correct Answer Incorrect Answer
    B 6 [6] [6,5,4,3,2,1] Correct Answer Incorrect Answer
    C 6 [6] [1,2,3,4,5] Correct Answer Incorrect Answer
    D 6 [6] [6,5,4,3,2] Correct Answer Incorrect Answer

    Solution

    The correct answer is C

    Practice Next
    ask-question