How to declare and add items to an array in Python?

前端 未结 7 583
轮回少年
轮回少年 2020-11-28 01:46

I\'m trying to add items to an array in python.

I run

array = {}

Then, I try to add something to this array by doing:



        
7条回答
  •  执念已碎
    2020-11-28 02:06

    I believe you are all wrong. you need to do:

    array = array[] in order to define it, and then:

    array.append ["hello"] to add to it.

提交回复
热议问题