Arshad Mehmood

Search the blog

    Today I Learned

    Iterate over nested lists

    python

    Python lists follow this logic when iterating: [thing for thing in list_of_things]

    mylist = [[x for x in range(10)] for _ in range(10)]