301.5 Concatenation and Basic Strings
Practise exam questionsConcatenation and Basic Strings — Note 1 of 3
Join multiple strings.
Concatenation means joining strings together using the + operator. Both sides must be str type — if one is a number, you must cast it first.
+ joins two strings: "Hello" + " World" → "Hello World"str typestr() to convert numbers before joiningfirst = "Hello"
second = "World"
print(first + " " + second) # Hello WorldBack to Concatenation and Basic Strings
Specification notes for programming are in Paper 2.