This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

Is "stringy" an adjective or adverb?


Another thing you may have noticed from the last example was a little gimmick called concatenation. This has nothing to do with a country filled with criminal cats. It has to do with putting text together, strings of text. You can just call them “strings” and most programmers will know what you’re talking about. (Who knows what those Lisp coders are talking about…)

In python we call the strings we’ve used so far literals, or string literals, and we can also use them in variables.

Note the difference between this one and the next one:

All I did was add the “r” in the beginning. This made all the characters literal characters. In python you can also do this with three quotations, as in…

“””This is a string… etc…significant.”””

Hey, there might come a time when you need this information!

We can also concatenate string variables:

By using the * symbol we repeat the variable x number of times.

There’s also this cool thing we can do called slicing…

Task Discussion