python code for learning purposes