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

找不到匯入的專案  請確認 <Import> 宣告中的路徑正確,而且檔案存在於磁碟上。

【Problem】  C:\inetpub\wwwroot\project\project.csproj : error  : 找不到匯入的專案 "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\W...