Update loremaster.py

First pass at making it pythonic