Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

list vs dictionary python

# Dictionaries are created with {} and are unordered. You access their elements with specific keys that you can assign.
# Lists are created with [] and are ordered. You can access their elements with the element's index.
cool_list = ["list", 1, True]
cool_dictionary = {"thisisa": "dictionary", "number": 1, "boolean": True}
# returns "list"
print(cool_list[0])
# returns "dictionary"
print(cool_dictionary["thisisa"])
Comment

PREVIOUS NEXT
Code Example
Python :: python sum only numbers 
Python :: http404 django 
Python :: cin python 
Python :: create feature dataset arcpy 
Python :: best time to buy and sell stock python 
Python :: root mean squared error in machine learning formula 
Python :: how to set class attributes with kwargs python 
Python :: wordcount pyspark 
Python :: interface in python 
Python :: how to divide string in python 
Python :: eia api python 
Python :: check if binary tree is balanced python 
Python :: remove rows from a dataframe that are present in another dataframe? 
Python :: python one line key increment or add 
Python :: plotting mean in density plot ggplot2 
Python :: bitwise operators in python 
Python :: i = 1 while i <= 100: print(i * *") i = i + 1 
Python :: states and capitals us comma separated list 
Python :: how to check whether input is string or not 
Python :: pandas fillna by rows 
Python :: maximun row and columns in python 
Python :: install python 3.4 mac terminal 
Python :: pyplot x vs y 
Python :: Tuple: Create tuple 
Python :: how to use return python 
Python :: Amazon price tracker in Python 
Python :: sqlite database python 
Python :: python getting line count 
Python :: conditional and in python 
Python :: pip in python 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =