string method
- print('My number is: {one}, and my name is: {two}'.format(one=num,two=name))
or
print('My number is: {}, and my name is: {}'.format(num,name))
best way is
print(f"He said his name is {name}")
Back
% operator with strings
Front
# % operator
text = "%d little pigs come out or I'll %s and %s and %s" % (3, 'huff', 'puff', 'blow down')
Back
.split() method for strings
Front
default splits on white space but can split on any designated - my_string.split(i) - splits the string on the letter i
Back
concatenation of strings
Front
x = x + " it's a beautiful day"
Back
pop
Front
removes an element from a list, defaults to remove last limit. list.pop() vs list.pop([0])