我试图将Python字典转换为字符串以用作URL参数.我确信有一种更好,更Pythonic的方式来做到这一点.它是什么?
x = "" for key, val in {'a':'A', 'b':'B'}.items(): x += "%s=%s&" %(key,val) x = x[:-1]
python dictionary url-parameters
dictionary ×1
python ×1
url-parameters ×1