Home Coding Data Structure – Lists 06

Data Structure – Lists 06

0
Data Structure – Lists 06

# Lists methods and function 
# We will see some of the most used method and function for lists
# We will see: 
# sort(), append(), len(list), count(), insert(), pop(), 
# index(), remove(), reverse(), extend(), max(list),
# min(list), clear(), copy(), type(list)
#
# REVERSE - CLEAR - TYPE

# I'm a list. Just a bunch of numbers
list1 = [7,"a",12.25]

# I want to be different. Just reverse me
list2 = list1.copy()
list2.reverse()

# Ok, I'm tired. Clear me, and let me go!
list1.clear()

# If I'm empty, what will I be? None, null, empty?
out1 = type(list1)

# copy www.AEC.codes
OUT = list2,list1,out1