What is the best way to create a string array in python?

后端 未结 11 1418
南旧
南旧 2021-02-03 17:45

I\'m relatively new to Python and it\'s libraries and I was wondering how I might create a string array with a preset size. It\'s easy in java but I was wondering how I might do

11条回答
  •  名媛妹妹
    2021-02-03 18:45

    But what is a reason to use fixed size? There is no actual need in python to use fixed size arrays(lists) so you always have ability to increase it's size using append, extend or decrease using pop, or at least you can use slicing.

    x = [''  for x in xrange(10)]
    

提交回复
热议问题