First attempt at writing code (python)