How to use join in python?
![](https://pythonpoint.net/wp-content/uploads/2020/12/Pink-and-Blue-Abstract-Moms-Influencer-Freestyle-Art-YouTube-Channel-Art-7-1024x576.jpg)
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))
![](https://pythonpoint.net/wp-content/uploads/2020/12/Screenshot-1093-1024x328.png)
e.g., (Tuple)
t= ('1', '2', '3', '4') s=',' print(s.join(t))
![](https://pythonpoint.net/wp-content/uploads/2020/12/Screenshot-1095-1024x290.png)
e.g.,
list1 = ['p', 'y', 't', 'h', 'o', 'n'] print("".join(list1))
![](https://pythonpoint.net/wp-content/uploads/2020/12/Screenshot-1097-1024x195.png)
This is how we use join() in python.
Subscribe
Login
Please login to comment
0 Discussion