How to find length of dictionary values

后端 未结 6 1701
忘了有多久
忘了有多久 2020-12-13 18:24

I am pretty new to all of this so this might be a noobie question.. but I am looking to find length of dictionary values... but I do not know how this can be done.

S

6条回答
  •  鱼传尺愫
    2020-12-13 18:52

    d={1:'a',2:'b'}
    sum=0
    for i in range(0,len(d),1):
       sum=sum+1
    i=i+1
    print i
    

    OUTPUT=2

提交回复
热议问题