🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Python Strings: questions with answers

15 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What is "Skills101"[2:5]?
  2. Q2. What does "a,b,,c".split(",") return?
  3. Q3. What does this print? (code)
  4. Q4. What is "python"[-3:]?
  5. Q5. What does "banana".find("z") return?
  6. Q6. What does this print? (code)
  7. Q7. What does this print? (code)
  8. Q8. What does this print? (code)
  9. Q9. What does this print? (code)
  10. Q10. Why does s[0] = "J" fail for a string s?
  11. Q11. What does this print? (code)
  12. Q12. What does this print? (code)
  13. Q13. What does this print? (code)
  14. Q14. Which code checks that a file name ends with ".pdf"?
  15. Q15. A string is a palindrome if it reads the same both ways. Which condition checks this for s?