-
-
Notifications
You must be signed in to change notification settings - Fork 46k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strings/join.py is incorrect #12408
strings/join.py is incorrect #12408
Comments
@osman-haider Please take a look at the merge requests |
The issue arises because you may have redefined or implemented your own version of the join function that does not behave as expected. The Python built-in str.join method works correctly, and you should ensure it is used instead of any custom implementation. Here’s how you can fix the issue: Check for redefinition of join: Ensure that the name join hasn’t been overridden in your code or by a module. Solution code snippet: s = ["", "", ""] def join(separator, iterable): s = ["", "", ""] If join is not behaving as expected: Check if join has been redefined by adding a print statement: print(join). |
Repository commit
3b1b70b
Python version (python --version)
Python 3.10
Dependencies version (pip freeze)
n/a
Expected behavior
s = ["", "", ""]
join(",", s) == ",".join(s)
',,' == ',,'
Actual behavior
s = ["", "", ""]
join(",", s) == ",".join(s)
'' != ',,'
The text was updated successfully, but these errors were encountered: