I'm very impressed. That is the shortest version of expense calculation I've ever seen.
I have written a python script back in 2007 for calculating two trips expenses: https://github.com/bernardeli/trip_money_organizer
I'm not a Python developer myself, however I was pretty happy with the result. I know it works fine, and have used few times with no issues.