List Functions
lucky_number = [4, 8, 15, 16, 23, 42] friends = ["Kevin", "Karen", "Jim", "Oscar", "Toby"] print(friends) //Output : ['Kevin', 'Karen', 'Jim', 'Oscar', 'Toby'] friends.extend(list(map(str, lucky_number))) print(friends) //Output : ['Kevin', 'Karen', 'Jim', 'Oscar', 'Toby', '4', '8', '15', '16', '23', '42'] friends.append("Creed") print(friends) //Output : ['Kevin', 'Karen', 'Jim', 'Oscar', 'Toby', '4', '8', '15', '16', '23', '42', 'Creed'] friends.insert(1, "Kelly") print(friends) //Output : ['Kevin', 'Kelly', 'Karen', 'Jim', 'Oscar', 'Toby', '4', '8', '15', '16', '23', '42', 'Creed'] friends.remove("Jim") print(friends) //Output : ['Kevin', 'Kelly', 'Karen', 'Oscar', 'Toby', '4', '8', '15', '16', '23', '42', 'Creed'] friends.pop() print(friends) //Output : ['Kevin', 'Kelly', 'Karen', 'Oscar', 'Toby', '4', '8', '15', '16', '23', '42'] friends.sort() print(friends) //Output : ['15', '16', '23', '4', '42', '8', 'Karen', 'Kelly', 'Kevin', 'Oscar', 'Toby'] friends.reverse() print(friends) //Output : ['Toby', 'Oscar', 'Kevin', 'Kelly', 'Karen', '8', '42', '4', '23', '16', '15'] print(friends.count("Kevin")) //Output : 1 friends2 = friends.copy() print(friends2) //Output : ['Toby', 'Oscar', 'Kevin', 'Kelly', 'Karen', '8', '42', '4', '23', '16', '15'] friends.clear() print(friends) //Output : []