1 Replies - 572 Views - Last Post: 12 June 2012 - 07:35 AM Rate Topic: -----

#1 mridulpv  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 05-September 10

dynamic array

Posted 12 June 2012 - 06:32 AM

how to create dynamic array in python?
Is This A Good Question/Topic? 0
  • +

Replies To: dynamic array

#2 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2112
  • View blog
  • Posts: 3,224
  • Joined: 21-June 11

Re: dynamic array

Posted 12 June 2012 - 07:35 AM

Python's lists are dynamic arrays. You create one by writing my_list = [] or my_list = [my, starting, contents] or using list comprehensions.

You can append to a list using the append method in amortized O(1) time.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1