4.5 Chapter Summary

Append

You can add two strings together using the + symbol. This is also called concatenate.

Capitalize

The capitalize function returns a new string with the first character capitalized.

Concatenate

You can use + to concatenate (append) two strings like this string3 = string1 + string2. This will create a new string called string3 with all the characters from the first string, string1, followed by all the characters in the second string, string2.

Function

A function returns a value. Function can take input as well, but don't have to. An example is the string lower() function that returns a string with all lowercase letters.

Immutable

Immutable means that it does not change. Strings are immutable in Python. When you call a function that appears to change a string, it will actually return a new string.

Index

An index is a number associated with the position of a character in a string. In Python the first character in a string is at index 0.

Object

An object can have behavior (things it can do). For example a turtle object can go forward a specified amount. Strings and turtles are objects in Python.

String

A string is a sequence of characters. You specify a string as characters inside a pair of single, double, or triple quotes.

Substring

A substring is a part of a string. One substring of "Hi there" would be "Hi".