Added solution in Python