2024-04-28 04:23:14 发布
网友
在这个字典初始化时得到一个语法错误,我不知道为什么。在
elif user_choice == "H" or user_choice == "h": if len(blockchain) >= 1: blockchain[0] = {"previous_hash": "", "index": 0, "transactions": [{"sender": "Chris", "recipient": "Max", "amount", 100.0}]}
在您的列表中,amount包含逗号而不是分号:
amount
[{"sender": "Chris", "recipient": "Max", "amount", 100.0}]
应该是:
[{"sender": "Chris", "recipient": "Max", "amount": 100.0}]
在您的列表中,
amount
包含逗号而不是分号:[{"sender": "Chris", "recipient": "Max", "amount", 100.0}]
应该是:
[{"sender": "Chris", "recipient": "Max", "amount": 100.0}]
相关问题 更多 >
编程相关推荐