我有一个类似于以下内容的文件:
Book
Key: Norris2013
Author: Elizabeth Norris
Title: Unbreakable
Publisher: Harper Collins Publishers
Date: 2013
Book
Key: Rowling1997
Author: J.K. Rowling
Title: Harry Potter and the Philosopher's Stone
Publisher: Bloomsbury Publishing
Date: 1997
Book
Key: Dickens1894
Author: Charles Dickens
Title: A tale of two cities
Publisher: Dodd, Mead
编辑:我将数据输入字典,如下所示:
^{pr2}$为什么它只打印出词典的最后一条?在
因为多次重复使用相同的键,所以您一次又一次地重写字典。您可能需要创建字典列表:
相关问题 更多 >
编程相关推荐