🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Python Strings: all 15 questions

Quiz: Python Strings · Question 4 of 15

What is "python"[-3:]?

What is "python"[-3:]?

  1. A."hon"
  2. B."pyt"
  3. C."noh"
  4. D."tho"
Answer & explanation

Correct answer: "hon"

-3 is the third character from the end; slicing to the end gives "hon".

Can you get the rest right without peeking?

Take the timed Quiz: Python Strings quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →