← 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 →- Q1. What is "Skills101"[2:5]?
- Q2. What does "a,b,,c".split(",") return?
- Q3. What does this print? (code)
- Q4. What is "python"[-3:]?
- Q5. What does "banana".find("z") return?
- Q6. What does this print? (code)
- Q7. What does this print? (code)
- Q8. What does this print? (code)
- Q9. What does this print? (code)
- Q10. Why does s[0] = "J" fail for a string s?
- Q11. What does this print? (code)
- Q12. What does this print? (code)
- Q13. What does this print? (code)
- Q14. Which code checks that a file name ends with ".pdf"?
- Q15. A string is a palindrome if it reads the same both ways. Which condition checks this for s?