Strings

a = "Hello World"
print(a[1])
print(a[4:9])
e
o Wor

Important: since they can’t change, all the methods applied to immutable objects are making copies of them! For example:

a = "Hello"
b = a.upper()
print(b)
print(id(a))
print(id(b))
HELLO
140402468101104
140402467911024