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


    Question

    Consider the following Python code: s =

    "PythonProgramming" part1 = s[2:6] # Corrected line part2 = s[-5:] print(part1 + part2) What will be the output of this code?
    A thonmming Correct Answer Incorrect Answer
    B thonramming Correct Answer Incorrect Answer
    C thonPmming Correct Answer Incorrect Answer
    D thonogramming Correct Answer Incorrect Answer
    E thonogram Correct Answer Incorrect Answer

    Solution

    Correct Answer: A (s[2:6] is "thon". s[-5:] is "mming". Concatenation: "thon" + "mming" = "thonmming".)

    Practice Next
    ask-question