Python: Python: iterating though strings and lists