2-dimensional lists - Programmers Heaven

Howdy, Stranger!

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


2-dimensional lists

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


  • bubbatremellbubbatremell Posts: 39Member
    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.