zoukankan      html  css  js  c++  java
  • Python学习之路-字典外传

    __author__ = "KuanKuan"
    info = {'teacher1': '苍井空',
          'teacher2': '京香',
          'teacher3': '波多野结衣',
          'teacher4': '小泽玛利亚',
          'teacher5': '上原瑞惠',
          'teacher6': '樱井莉亚',
          'teacher7': '桃谷绘里香'}
    print(info.keys())
    d = list(info.keys())[0]
    b = list(info.values())[0]
    print(d,b)
    
    for index in range(len(info)):
        print(index,list(info.keys())[index],list(info.values())[index])
    print("~"*168)
    for index in range(len(info)):
        print(index,list(info.keys()),list(info.values()))
    # dict_keys(['teacher1', 'teacher2', 'teacher3', 'teacher4', 'teacher5', 'teacher6', 'teacher7'])
    # teacher1 苍井空
    # 0 teacher1 苍井空
    # 1 teacher2 京香
    # 2 teacher3 波多野结衣
    # 3 teacher4 小泽玛利亚
    # 4 teacher5 上原瑞惠
    # 5 teacher6 樱井莉亚
    # 6 teacher7 桃谷绘里香
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # 0 ['teacher1', 'teacher2', 'teacher3', 'teacher4', 'teacher5', 'teacher6', 'teacher7'] ['苍井空', '京香', '波多野结衣', '小泽玛利亚', '上原瑞惠', '樱井莉亚', '桃谷绘里香']
    # 1 ['teacher1', 'teacher2', 'teacher3', 'teacher4', 'teacher5', 'teacher6', 'teacher7'] ['苍井空', '京香', '波多野结衣', '小泽玛利亚', '上原瑞惠', '樱井莉亚', '桃谷绘里香']
    # 2 ['teacher1', 'teacher2', 'teacher3', 'teacher4', 'teacher5', 'teacher6', 'teacher7'] ['苍井空', '京香', '波多野结衣', '小泽玛利亚', '上原瑞惠', '樱井莉亚', '桃谷绘里香']
    # 3 ['teacher1', 'teacher2', 'teacher3', 'teacher4', 'teacher5', 'teacher6', 'teacher7'] ['苍井空', '京香', '波多野结衣', '小泽玛利亚', '上原瑞惠', '樱井莉亚', '桃谷绘里香']
    # 4 ['teacher1', 'teacher2', 'teacher3', 'teacher4', 'teacher5', 'teacher6', 'teacher7'] ['苍井空', '京香', '波多野结衣', '小泽玛利亚', '上原瑞惠', '樱井莉亚', '桃谷绘里香']
    # 5 ['teacher1', 'teacher2', 'teacher3', 'teacher4', 'teacher5', 'teacher6', 'teacher7'] ['苍井空', '京香', '波多野结衣', '小泽玛利亚', '上原瑞惠', '樱井莉亚', '桃谷绘里香']
    # 6 ['teacher1', 'teacher2', 'teacher3', 'teacher4', 'teacher5', 'teacher6', 'teacher7'] ['苍井空', '京香', '波多野结衣', '小泽玛利亚', '上原瑞惠', '樱井莉亚', '桃谷绘里香']
  • 相关阅读:
    Fibonacci数列--矩阵乘法优化
    没有上司的舞会--树形DP
    扩展欧几里德--解的个数
    洛谷 P1284 三角形牧场 题解(背包+海伦公式)
    2017-2018 ACM-ICPC Latin American Regional Programming Contest J
    求1-1e11内的素数个数(HDU 5901 Count primes )
    Educational Codeforces Round 96 (Rated for Div. 2) E. String Reversal 题解(思维+逆序对)
    HHKB Programming Contest 2020 D
    牛客练习赛71 数学考试 题解(dp)
    2019-2020 ICPC Asia Hong Kong Regional Contest J. Junior Mathematician 题解(数位dp)
  • 原文地址:https://www.cnblogs.com/JankinYu/p/8457382.html
Copyright © 2011-2022 走看看