Is there a better way to flatten out a multidimensional list? def alist(x):
    if x == 1:
        return 1
    return [alist(x - 1), x, alist(x - 1)]
l = '%r' % alist(int(raw_input('Maximum Number Of Asterisks: ')))
f = l.replace("[", "").replace("]", "").replace(",", "").replace(" ", "")
for i in f:
    print "*" * int(i)


So, basically, I just formatted the list into a string, removed all unwanted characters (left bracket, right brakcer, comma, and space), and for every number in that string, printed the appropriate amount of asterisks. If there is anything you don't understand, sorry because I had to type this up in under 2 minutes, so please just post a comment and I'll try to answer as soon as I can.
Without many details, maybe the following can help you:

&gt;&gt;&gt; import itertools
&gt;&gt;&gt; list_of_lists = [['item_1'], ['item_2', 'item_3'], ['item_4', 'item_5', 'item_6']]
&gt;&gt;&gt; chain = list(itertools.chain(*list_of_lists))
&gt;&gt;&gt; print chain
['item_1', 'item_2', 'item_3', 'item_4', 'item_5', 'item_6']


Take a look at this question, there are some answers that might help you.