Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


2-dimensional lists

LEN44LEN44 Member Posts: 1
I'm somewhat of a newb to Python and I don't know how to make 2D lists. Could anyone help me?


  • bubbatremellbubbatremell Member Posts: 39
    There's a number of ways to do it. The key to all of them is remembering that lists can hold anything. So,
    e = [[] for x in range(10)]
    #generates a list with 10 other lists in it, so you can do stuff like

    I suppose you could build it manually, or with a loop, if you like.
    e = []
    for x in range(10):

Sign In or Register to comment.