Python Strings Quiz

  • Questions: 15
  • Easy
  • Pass mark: 70%

Names, messages and commands all live in strings, and a few string rules catch beginners out: indexes start at 0, + will not join text and a number, and string methods return a new string instead of changing the old one. This free quiz has 15 short questions on working with strings in Python.

What the quiz covers

  • Joining strings with +, repeating them with * and counting characters with len()
  • Indexing and slicing, including negative indexes and reversing a string
  • Case methods such as upper() and title(), and why a method does not change the original string
  • Checking text with in, == and <
  • Searching and splitting with find(), count(), split() and join()

How it works

  • 15 questions: 11 with one correct answer, 4 where you select every correct answer
  • After each question you see the correct answer and a short explanation
  • No time limit and no account needed
  • Score 70% or more (11 of 15) to pass

Each topic has a runnable example: creating and joining strings, string indexing and slicing, upper, lower and strip and find, count, replace and split. After this one, try the Python print() Quiz or the Python Data Types Quiz.