liste = [1,2,3,4,5]
liste.append(6)
liste
[1, 2, 3, 4, 5, 6]
liste.append("Python")
liste
[1, 2, 3, 4, 5, 6, 'Python']
liste1 = [1,2,3,4,5,6,7]
liste2 = [10,20,30]
liste1.extend(liste2)
liste1
[1, 2, 3, 4, 5, 6, 7, 10, 20, 30]
liste = [1,2,3,4,5,6,7,8,9]
liste.insert(2,"Python")
liste
[1, 2, 'Python', 3, 4, 5, 6, 7, 8, 9]
liste.insert(0,"Java")
liste
['Java', 1, 2, 'Python', 3, 4, 5, 6, 7, 8, 9]
liste = [1,2,3,4,5,6,7]
liste.pop()
7
liste
[1, 2, 3, 4, 5, 6]
liste.pop(2)
3
liste
[1, 2, 4, 5, 6]
liste = ["Python","Php","Java","C"]
liste.remove("Python")
liste
['Php', 'Java', 'C']
liste.remove("Javascript")
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-22-d658b7dd9b2e> in <module>() ----> 1 liste.remove("Javascript") ValueError: list.remove(x): x not in list
liste = [1,2,3,4,3,3,5,6,7,8,9]
liste.index(3)
2
liste.index(3,3)
4
liste.index(10)
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-37-459049a1d125> in <module>() ----> 1 liste.index(10) ValueError: 10 is not in list
liste = [1,2,3,4,5,6,1,1,1,1,1,1,1,1,8]
liste.count(1)
9
liste.count(10)
0
liste = [12,-2,3,1,34,100]
liste.sort()
liste
[-2, 1, 3, 12, 34, 100]
liste = ["Python","Php","Java","C"]
liste.sort()
liste
['C', 'Java', 'Php', 'Python']
liste = [12,-2,3,1,34,100]
liste.sort(reverse = True)
liste
[100, 34, 12, 3, 1, -2]
liste = ["Python","Php","Java","C"]
liste.sort(reverse = True)
liste
['Python', 'Php', 'Java', 'C']