Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python get value from list

list1 = ['physics', 'chemistry', 1997, 2000]
list2 = [1, 2, 3, 4, 5, 6, 7]

print("list1[0]: ", list1[0])
print("list2[1:5]: ", list2[1:5])

# Test Results:
list1[0]:  physics
list2[1:5]:  [2, 3, 4, 5]
Comment

PREVIOUS NEXT
Code Example
Python :: how to import somthing from another directory in pyhon 
Python :: any all in python 
Python :: python random numbers 
Python :: private key 
Python :: string to ascii with python 
Python :: convert ipynb to py 
Python :: combine 3 jupyter cells together 
Python :: exponent function in python 
Python :: python with quick sort 
Python :: frequency meaning 
Python :: describe in python 
Python :: string representation of date time 
Python :: numpy column 
Python :: what does abs do in python 
Python :: if or python 
Python :: print all objects in list python 
Python :: How to JOIN three tables with Django ORM 
Python :: python print new line 
Python :: python print text 
Python :: hash table data structure python 
Python :: django orm 
Python :: how to connect mongodb database with python 
Python :: get sum of 2d array python 
Python :: python sort based on multiple keys 
Python :: concatenate lists 
Python :: Python Map Function Syntax 
Python :: range(n,n) python 
Python :: Reset Index & Retain Old Index as Column in pandas 
Python :: quadrilateral 
Python :: codegrepper is cool 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =