# list v = [3,4,5,6,7,7,7,7] m = ["ajhg", "sdhajk", "ahajksh"] # print the list print(v) # reach to list items print(v[2]) print(v[-5]) #lenght of the list print(len(v)) # check if item is exist in list or not if 5 in v: print("yes, item=5 is exists") #change list item v[2] = "dsjhvj" print(v) m[0:1] = ["water", "cup"] print(m) # how you can insert item in the list insert() thislist = ['d', 'd', 'f', 'f'] thislist.insert(2, "hello") print(thislist) thislist.append("dhshsdhd") #add to the end print(thislist) thislist.extend(m) print(thislist) #remove list item : remove(value of the item) y = [1,3,5,67,8,90,43,98] y.remove(67) print(y) # remove item by index: pop(index) y = [1,3,5,67,8,90,43,98] y.pop(5) print(y) # delete the last item from list y.pop() print(y) # clear all the list item: clear() y.clear() print(y) # for loop u = [100,33,5,67,8,7,43,98] for i in u: print(i) for i in range(len(u)): u[i] = u[i]+2 print(u) # sort list items u.sort() print(u) thislist = ['uwdsf', 'adffs', 'pdsfs', 'dffgd'] thislist.sort() print(thislist) k=u=[7, 9, 10, 35, 45, 69, 100, 102] k.sort(reverse=True) print(k)