I note that the solution is invalid at the bottom of my post, but it is worth mentioning that I know all of the students in the group session when I teach this problem, and I am familiar with their background. If I know that a student has prior Python experience, I will discuss the string solution with them, but let them know not to use it in their homework until strings have been covered in class.
In this case, even though the solution is disallowed for grading purposes, there is an opportunity to discuss it during the lesson.