Python Strings Foundation
Python Foundation Visual

Strings

Foundation lesson for Strings. Read the diagram, then check yourself with the quiz.

Picture this: a string is a row of characters

You can index, slice, and loop characters like a list of letters — but a string is immutable.

"Kodin"text
→
[0] → Kfirst char
→
slicea piece
→
new stringmethods return copies

In easy words

Foundation lesson for Strings. Read the diagram, then check yourself with the quiz.

Diagram — characters and indexes

K0 o1 d2 i3 n4 s = "Kodin" → s[::-1] reverses, s[0] is first char

How to learn this in Kodin

Study the diagram, answer the topic quiz, then open Practice problems in the editor.

Run indexing, slice, and reverse

1s = "Kodin"
2print(s[0]) # first char
3print(s[1:4]) # slice
4print(s[::-1]) # reverse
Output:

Example Program

1s = "Kodin"
2print(s[0])
3print(s[1:4])
4print(s[::-1])

Strings — Topic Quiz

Check understanding

Answer all questions, then click Check answers. Use this before Practice in the editor.

Q1. Are Python strings mutable?

Q2. What does s[::-1] do?

Q3. Which counts vowels best?

Q4. f-strings help with…

Score: —