Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python list operation

# Creating a List with
# the use of multiple values
List = ["Geeks", "For", "Geeks"]
print("
List containing multiple values: ")
print(List)
  
# Creating a Multi-Dimensional List
# (By Nesting a list inside a List)
List2 = [['Geeks', 'For'], ['Geeks']]
print("
Multi-Dimensional List: ")
print(List2)
  
# accessing a element from the
# list using index number
print("Accessing element from the list")
print(List[0])
print(List[2])
  
# accessing a element using
# negative indexing
print("Accessing element using negative indexing")
      
# print the last element of list
print(List[-1])
      
# print the third last element of list
print(List[-3])
Comment

PREVIOUS NEXT
Code Example
Python :: selenium wait until 
Python :: django edit object foreign key id 
Python :: |safe django 
Python :: python remove the element in list 
Python :: when iterating through a pandas dataframe using index, is the index +1 able to be compared 
Python :: how to sort numpy array 
Python :: .corr python 
Python :: python ignore first value in generator 
Python :: convert ipynb to py 
Python :: how to separate numeric and categorical variables in python 
Python :: flow of control in python 
Python :: python multidimensional dictionary 
Python :: create an empty list in python 
Python :: create payment request in stripe 
Python :: class inheritance 
Python :: xml to python list in python 
Python :: python functools 
Python :: pdf to word 
Python :: django orm filter 
Python :: python using set 
Python :: NaN stand for python 
Python :: how to use str() 
Python :: deque in python 
Python :: oops python 
Python :: python sort based on multiple keys 
Python :: python add 
Python :: google map distance 
Python :: What Is Python Recursive Function in python 
Python :: tkinter hide legend 
Python :: pd sample every class 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =