Join concept in python
city = ["Fsd", "lhr", "mlt", "pandi"]
# first method to print the list or normal method
# for items in city:
# print(items, "and", end=" ")
# second and new method to print the list with join() function
a=", ".join(city)
print(a, "and other cites")
Comments
Post a Comment