Also add separator as an optional argument to builtin list_join().
[1, 2, 3].join(',') looks better than list_join([1, 2, 3], ',').
However, list_join() is used in string interpolation, and builtin function is faster than method call.
So keep builtin list_join() but add a new method to List class.
Also add separator as an optional argument to builtin list_join().
[1, 2, 3].join(',')
looks better thanlist_join([1, 2, 3], ',')
. However, list_join() is used in string interpolation, and builtin function is faster than method call. So keep builtin list_join() but add a new method to List class.Example:
Output: