Physics excersizes in python