Working with strings
Strings have many handy methods:
s = " Hello, World "
print(s.strip()) # "Hello, World" — no spaces at the ends
print(s.lower()) # lowercase
print(s.replace("World", "Python"))
print("a-b-c".split("-")) # ['a', 'b', 'c']
print("-".join(["a", "b"])) # "a-b"
The slice s[::-1] reverses a string. ord("a") gives a character's code, chr(97) gives a character by its code. c.isalpha() checks that a character is a letter.