Solved 1.py in a single line.
Problem 2 solved.
Solution to 3. Not the fastest, probably. ~77ms.
Formatting changes: PEP8.
Solution 4