Declare an empty List in Python Lists are just like the arrays, declared in other languages. Lists need not be homogeneous always which makes it the most powerful tool in Python. A single list may contain DataTypes like Integers, Strings,
Tag: Python-list-methods
Python join() functionPython join() function
Python join() function The join() method is a string method and returns a string in which the elements of sequence have been joined by str separator. Syntax: string_name.join(iterable) string_name: It is the name of string in which joined elements of
Python extend() methodPython extend() method
Python extend() method extend() function Iterates over its argument and adding each element to the list and extending the list. The length of the list increases by number of elements in it’s argument. syntax: # Each element of an iterable gets
Python append() functionPython append() function
Python append() function Append function Adds its argument as a single element to the end of a list. The length of the list increases by one. syntax: # Adds an object (a number, a string or a # another list)