#This is to explain the concept of lists as used in python.
# A list is a strcutre to store a "List" of information
friend = ["Kevin", "Karen", "Jim", "Jim", "Jim","Shoham","Digo"]
lucky_numbers = [ 4, 8, 15, 16, 23, 42]
print(friend)
print(lucky_numbers)

#copy is used to create a new list by copying an old list
friends_2=friend.copy()
print(friends_2)

#sort is used to sort the list in ascending/alphabetical order
friend.sort()
print(friend)
lucky_numbers.sort()
print(lucky_numbers)

#reverse is used to srot in the descending/reverse alphabetical order
friend.reverse()
print(friend)
lucky_numbers.reverse()
print(lucky_numbers)

#entend  is like concatenation
friend.extend(lucky_numbers)
print(friend)

#append  just adds its argument to the end of the list
friend.append("Creed")
print(friend)

#insert  is append but it can be used anywhere in the list
#with the first argument being the position where the second
#argument is to be inserted.
friend.insert(1,"Hell No")
print(friend)

#To remove an element from a list,
friend.remove("Jim")
print(friend)

#pop is used to remove the last element in a list
friend.pop()
print(friend)

#index returns the index of the argument as it occurs in the list.
#If the object is not on the list, we get an error message
print(friend.index("Shoham"))

#count function is used to find the frequency of occurance of the argument
#as it appears in the list.
print(friend.count("Jim"))

#To completely reset the list, use 
friend.clear()
print(friend)
