py for prob 1