Month: June 2017

List in Python

List in Python is like ArrayList in Java. The elements are addressed by index which starts from 0. The list may contain elements of different data types unlike arrays in C or C++. Python has lots of in-built functionalities when it comes to list: cmp(list1, list2) len(list) max(list) min(list) list(sequence) – tuples are converted into a list Let’s see rest of the functions of list in python in action. Note: This is Command Line Python >>> a_list = [] >>> a_list [] >>> a_list = ["something",234] >>> a_list ['something', 234] >>> a_list[0] 'something' >>> a_list.count(234) 1 >>> a_list.append(334) >>> a_list ... Read more