Friday, 15 May 2020

【Python】將dict字典的Key值連在一起列印

【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

IIS HTTP Error 403.18

 HTTP Error 403.18 - Forbidden The specified request cannot be processed in the application pool that is configured for this resource on the...