字典循环默认取key例子
dict={‘name‘:‘john‘,‘number‘:‘201801‘,‘weight‘:‘80kg‘,‘tall‘:‘180cm"} #------直接循环字典默认取key------ for i in dict: print(i) #-----也可以循环key--------- for i in dict(keys): print(i) #------循环值--------------- for i in dict(values): print(i)
原文地址:https://www.cnblogs.com/isac/p/8931134.html
时间: 2024-10-13 22:45:54