Update Problem301.py

The Python function call overhead was increasing run time by a factor of
2! Remove the nim function and inline instead.