无效的语法(<未知>,第89行)-pylint(语法错误)

时间:2019-04-22 16:15:48

标签: python blockchain

在此字典初始化过程中遇到语法错误,我不知道为什么。

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}]}

1 个答案:

答案 0 :(得分:3)

在您的列表中,amount带有逗号而不是分号:

[{"sender": "Chris", "recipient": "Max", "amount", 100.0}]

应该是:

[{"sender": "Chris", "recipient": "Max", "amount": 100.0}]