# Author: James Tam # Version: October 18, 2024 #Create fixed size list aList = [1.5,True,"tam",123,"james tam"] #Checking for an occurrence if "tam" in aList: print("tam is an element in the list") #Length print("List has %d elements" %len(aList)) #Adding single element to the end: appened aList.append("another tam") #Extending with another list listOfTams = ["tam1","tam2"] aList.extend(listOfTams) print("Updated list", aList) aList = [3,1,12,1] #Sorting in ascedning order aList.sort() print(aList) #Reversing order aList.reverse() print(aList) #Counting instances of an element print("How many times the value 1 is in the list %d" %(aList.count(1)))