How to use join in python?
Join function can be used in various ways with lists, dictionaries, tuples and strings.
Here we’ll see some example how to use join() function in python.
e.g., (Lists)
l = ['1', '2', '3', '4'] s = ', ' print(s.join(l))
e.g., (Tuple)
t= ('1', '2', '3', '4') s=',' print(s.join(t))
e.g.,
list1 = ['p', 'y', 't', 'h', 'o', 'n'] print("".join(list1))
This is how we use join() in python.
Subscribe
Login
Please login to comment
0 Discussion