Text (strings)
P40.text-and-numbers.02 · Audience: guest, language-pro, it-ml · Prerequisites: Numbers and arithmetic
Text is the material you work with all day. Before any code, imagine tidying a name that arrived split across two boxes — join the parts, capitalise a heading, count the letters. This module gives those everyday tidying moves their Python names, one at a time.
ⓘ Concept: A string is text inside quotes
"ada". You join two strings with + — the same sign as adding, but for text: first + " " + last glues a first and last name into "ada lovelace", exactly as you would write a letterhead. The text itself never changes; + hands you a new copy.Why it matters — Text is a language professional's raw material. Seeing that code handles words with a few named, ordinary moves makes the notebook feel like a tool for your work.
Ask the mentor about this module
Ask a question about this content. The mentor explains and grounds its answer in what you are studying; asking is recorded as a learning signal, not a grade.
🎓 Practice ladder
1 graded rung · ~5 minYour turn: a name came in split in two. Join the parts with a space, make a capitalised headline, and count the characters — the tidying you just stepped through — then press Run.
Explorer rung — tidy a messy line
Loading exercise…
Where next?
Later in Text & Numbers
Go up a level