'str' is the builtin name of the string class. Using that as a parameter name is a bad idea and a bad habit to teach. I suggest 'txt' instead.