Python 'list indices must be integers, not tuple"

前端 未结 3 1985
南旧
南旧 2021-02-01 02:21

I have been banging my head against this for two days now. I am new to python and programming so the other examples of this type of error have not helped me to much. I am readin

3条回答
  •  无人及你
    2021-02-01 02:52

    To create list of lists, you need to separate them with commas, like this

    coin_args = [
        ["pennies", '2.5', '50.0', '.01'],
        ["nickles", '5.0', '40.0', '.05'],
        ["dimes", '2.268', '50.0', '.1'],
        ["quarters", '5.67', '40.0', '.25']
    ]
    

提交回复
热议问题