Last active
June 4, 2020 05:50
-
-
Save SushmaBaliza/7b4ff1fc66441dd1b9070ff2eed4c213 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
list_1 = [2, 4, 6, 7, 10, 12, 13, 15, 17] | |
print(list_1) | |
# Returns new value for 4th element | |
list_1[3] = 8 | |
print(list_1) | |
# Returns new value for 7th, 8th & 9th element | |
list_1[6:9] = [14, 16, 18] | |
print(list_1) | |
# Returns new value as string | |
list_1[0] = "Code Refer" | |
print(list_1) | |
# Provided value for out of range index | |
list_1[11] = 20 | |
print(list_1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment