【Python】將dict字典的Key值連在一起列印
dic = {"key 1":"value 1","key b":"value b"}
keyPrint =""
#print the keys:
for key in dic:
keyPrint += str(key)+" "
print (keyPrint)
Reference:
https://stackoverflow.com/questions/5904969/how-to-print-a-dictionarys-key
No comments:
Post a Comment