World's Best AI Learning Platform with profoundly Demanding Certification Programs
Designed by IITians, only for AI Learners.
Internship Partner

In Association with
In collaboration with



Designed by IITians, only for AI Learners.
Internship Partner
In Association with
In collaboration with
New to InsideAIML? Create an account
Employer? Create an account
Designed by IITians, only for AI Learners.
Internship Partner
In Association with
In collaboration with
Enter your email below and we will send a message to reset your password
Designed by IITians, only for AI Learners.
Internship Partner
In Association with
In collaboration with
By providing your contact details, you agree to our Terms of Use & Privacy Policy.
Already have an account? Sign In
Designed by IITians, only for AI Learners.
Internship Partner
In Association with
In collaboration with
By providing your contact details, you agree to our Terms of Use & Privacy Policy.
Already have an account? Sign In
Download our e-book of Introduction To Python
4.5 (1,292 Ratings)
589 Learners
Shekhar Ravat
2 years ago
list_1 = [96, 97.5, 'Physics','Chemistry']
list_2 = [1, 2, 3, 4, 5 ]
list_3 = ["a", "b", "c", "d"]
#!/usr/bin/python
list_1 = [96, 97.5, 'Physics','Chemistry']
list_2 = [1, 2, 3, 4, 5 ]
print("list_1[2]: ", list_1[2])
print("list_2[2:]: ", list_2[2:])
list_1[2]: Physics
list_2[2:]: [3, 4, 5]
#!/usr/bin/python
list = ['physics', 'chemistry', 1997, 2000]
print("Value available at index 2 : ")
print(list[2])
list[2] = 2001
print("New value available at index 2 : ")
print(list[2])
Value available at index 2 :
1997
New value available at index 2 :
2001
#!/usr/bin/python
list_1 = ['physics', 'chemistry', 1997, 2000]
print(list_1)
del list_1[2]
print("After deleting value at index position 2 : ")
print(list_1)
print("=============")
list_1.remove('physics)
print(list_1)
['physics', 'chemistry', 1997, 2000]
After deleting value at index position 2 :
['physics', 'chemistry', 2000]
=============
['chemistry, 2000]
list_1 = ['Physics', 'Chemistry']
list_2 = ['Math', 'Science', 'Social']
list_1.append(list_2)
print(list_1)
print("===========================")
# again execute same set of code by using extend attribute
list_1 = ['Physics', 'Chemistry']
list_2 = ['Math', 'Science', 'Social']
list_1.extend(list_2)
print(list_1)
['Physics', 'Chemistry', ['Math', 'Science', 'Social']]
===========================
['Physics', 'Chemistry','Math', 'Science', 'Social']