【问题标题】:why there is multiple values for dictionary key in python?为什么python中的字典键有多个值?
【发布时间】:2022-07-05 03:32:29
【问题描述】:

我在看python课程,看到一行代码看不懂

books_dict[title] = [author,subject,year]

我从这一行看到的是 books_dict 的键是标题并且它有多个值?

【问题讨论】:

    标签: python dictionary


    【解决方案1】:

    只有一个值,该值是一个列表。名单是[author, subject, year]

    【讨论】:

      猜你喜欢
      • 2014-01-13
      • 2013-08-31
      • 2011-06-09
      • 1970-01-01
      • 2021-08-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多