dreamcode
Back to map
Strings · Lesson 2 of 6
+15 XP on finish
PYTHON BASICS

Words and text

A string is text wrapped in quotes. You can glue strings together with +, repeat them with *, and ask how long one is with len().

How it reads
+ joins strings end to end, so "night" + "sky" becomes "nightsky"
* repeats a string, so "night" * 3 is "nightnightnight"
len(first) counts the characters, here 5
Cloud tip: Quotes can be "double" or 'single', as long as both ends match.
main.py
PYTHON
real Python, runs in your browser
CONSOLE
- run your code to see output -