s = "abcdefghijklm"
len(s)
s[7]
s[7:12]
s[7:12] + s[2:5]
a = [10,20,30,40,50,60]
len(a)
a[2:4]
a[2:4] + [90,100]
t = 'x"y"z'
u = "def"
v = '''lmn
opq
rst'''
len(v)
t+u+v
print(t+u+v)
b = ["John", "Jimmy","Alice"]
len(b)
len(b[0])
HANGMANPICS = ['''
+---+
| |
|
|
|
|
=========''', '''
+---+
| |
O |
|
|
|
=========''', '''
+---+
| |
O |
| |
|
|
=========''', '''
+---+
| |
O |
/| |
|
|
=========''', '''
+---+
| |
O |
/|\ |
|
|
=========''', '''
+---+
| |
O |
/|\ |
/ |
|
=========''', '''
+---+
| |
O |
/|\ |
/ \ |
|
=========''']
len(HANGMANPICS)
len(HANGMANPICS[0])
len(HANGMANPICS[2])
x = list(range(17,46))
print(x)
for x in range(5,10):
print(x*x*x)
for x in b:
print(x)
for x in HANGMANPICS:
print(len(x))
## Accumulator Pattern of Programming
picLengths = []
for x in HANGMANPICS:
picLengths.append(len(x)) # accumulate length of picture into picLengths
## end of pattern
print(picLengths)