s = ''
type(s)
"python"[0] # 'p'
"python"[1] # 'y'
"python"[2] # 't'
"python"[3] # 'h'
"python"[4] # 'o'
"python"[5] # 'n'
word = "foo"
word[1] = "r"
# TypeError: 'str' object does not support item assignment
for letter in "python":
print letter
>>
"""
p
y
t
h
o
n
"""
"b" in "abc" # True
"d" in "abc" # False
"d" not in "abc" # True
"b" not in "abc" # False
Len()
method
Show string length
s = "foo"
len(s)
# 3
Upper()
method
Caps Lock.
"foo".upper() # FOO
lower()
method
Lowercase.
"FOO".lower() # foo
str()
method
Converts to string
num = 123
type(num) # <class 'int'>
type(str(num)) # <class 'str'>