-
-
Save IndhumathyChelliah/8bec2924f7e1e161c06a196cc84cde65 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
t=('red','blue','green',1,2,3) | |
#Changing tuple to list | |
t1=list(t) | |
print (t1) #Output: ['red', 'blue', 'green', 1, 2, 3] | |
# Inserting items to list | |
t1.insert(0,'yellow') | |
#Converting to tuple back | |
t=tuple(t1) | |
print (t) #Output: ('yellow', 'red', 'blue', 'green', 1, 2, 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment