Created
July 28, 2020 13:41
-
-
Save FerdinaKusumah/f3a4da16798cff31b27e3971fac3a644 to your computer and use it in GitHub Desktop.
[Python] merge list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Merge list""" | |
"""string list""" | |
words = ["a", "b", "c", "d"] | |
print(f'merge string list is {",".join(words)}') | |
# merge string list is a,b,c,d | |
"""number list""" | |
number = [1, 2, 3, 4, 5, 6] | |
print(f'merge number list is {",".join(map(str, number))}') | |
# merge number list is 1,2,3,4,5,6 | |
"""mix list""" | |
mix = [1, 2, "a", "b", "c", True, False, 2.0, 3.0000] | |
print(f'merge mix list is {",".join(map(str, mix))}') | |
# merge mix list is 1,2,a,b,c,True,False,2.0,3.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment