Fixed multiple errors in code: int is not iterable, spacing errors