# dictionary
A = None # none = null
b = False # Boolean
C, D = A, 10.6 # int Float
E = ' ASDD ' # str
f = [' s ', ' E '] # list, array, can be added and censored
G = (' A ', ' s ', ' F ') # tuple (tuple), can only be checked
# dictionary
T = {
# Key: Value
"' :',
"' : '
}
# dictionary
# dict Key:value key is unique, unordered
H= {
' s ': 12,
' F ': False,
2: ' d ',
' R ': ' t ',
' SD ': [' GF ',' RT ',' ew '],
' RT ': (' RTE ',' EWR '),
' ru ': {
' rty ': ' FGHG ',
' dfs ': ' Yjtujyt '
}
}
# print (h)
Print(H[' ru '])# Remove the value of the specified key as Ru
# Take out all the keys
Keys = H.keys()
Print(keys)
# Traverse all the Key
For I in List (keys):
Print ('%s =%s '% (I, h[i]))
ABC = {' AA ': ' DD ', ' BB ': ' th '}
Print(ABC)
Print(type(ABC)) # View the data type of ABC
AAA = Str(ABC) # dictionary to Str
Print(type(aaa))
Print(aaa)
BBB = eval(aaa) # str to Dictionary
Print(type(bbb))
Print(bbb)
# String to Dictionary
BBB = eval(aaa)
Print(type(bbb))
Print(bbb)
# dictionary Json:json Nature is a string, just a certain rule of conversion
Json.dumps(h)
Print(d_json)
Print(type(d_json))
# JSON (str) to dictionary: convert JSON format to dictionary format
Json.loads(d_json)
Print(type(json_dict))
Print(json_dict)
Python Interface Automation Test ten: Simple processing between dictionaries, strings, and JSON