Last active
July 5, 2019 08:33
-
-
Save devmnj/485e4347442a2b425f1b09c538583b9f to your computer and use it in GitHub Desktop.
Python : Converting List into Tuple List
This file contains 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
# This code will show how you can convert a list into tuple list | |
print('Touple meet List') | |
l1=['Python','C','C++','C#','GO','Dart','Kotlin'] # the list | |
# List elements to touples | |
x=[(x,) for x in l1] | |
print(x) | |
Out Put | |
Touple meet List | |
[('Python',), ('C',), ('C++',), ('C#',), ('GO',), ('Dart',), ('Kotlin',)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment