-
-
Save IndhumathyChelliah/d35bd6c56c69082c041ff90865086d22 to your computer and use it in GitHub Desktop.
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
even=[2,4,6,8] | |
odd=[1,3,5,7,9] | |
num= *even,*odd | |
print (list(num)) | |
#Output:[2, 4, 6, 8, 1, 3, 5, 7, 9] | |
#or | |
num=[*even,*odd] | |
print (list(num)) | |
#Output: [2, 4, 6, 8, 1, 3, 5, 7, 9] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Do we need to include list() in the second code provided above?
num=[*even,*odd]
print ((num))
print (type(num))
[2, 4, 6, 8, 1, 3, 5, 7, 9]
<class 'list'>