Python_3

Run Settings
LanguagePython
Language Version
Run Command
#DICTIONARIES -> {'key':value, ... }, unordered key value pair, can store any value types # dictionary = {'a':[1,2,3] , 'b':'hello', 'x':True} # print(dictionary['a'][0]) # -> accesing # my_list = [ # { # 'a':[1,2,3], # 'b':'hello', # 'x':True # }, # { # 'a':[4,5,6] , # 'b':'hello', # 'x':True # } # ] # print(my_list[0]['a'][2]) # -> accesing the value of the dict in the list #dict keys -> keys msut be immutuable, descriptive, unique #dictionary methods user = {'basket':[1,2,3] , 'greet':'hello', 'age': 20} user2 = dict(name = 'JOJO') # not common way to create a dictionary #print(user.get('age','25')) #dictionary methods2 # print('age' in user.keys()) # print('hello' in user.values()) # print(user.items()) #print(user.clear()) # user2 = user.copy() # print(user2) # print(user.pop('age')) # print(user) print(user.update({'age': 23})) print(user)
Editor Settings
Theme
Key bindings
Full width
Lines