python lab solns: make compatible with python3