

Ask HN: Conditional statements with Python nested lists - zeynel1

I asked this question at Stackoverflow but I was wondering if you can help.<p>http://stackoverflow.com/questions/4011728/conditional-statements-with-python-lists<p>I am trying to build a simple app in GAE that will take a string <i>s</i> from user and check if it is same as the previous string <i>s0</i>; if same, the string will appear in the same column; if not it will move to the next column.<p>Like this:<p><pre><code>    Hello world
    Hello world
    Hello world
    
    Hello world  Hello Universe
    Hello world
    Hello world

    Hello world  Hello Universe
    Hello world  Hello Universe
    Hello world  Hello Universe
                 Hello Universe
                 Hello Universe

    Hello world  Hello Universe Hello Cosmos
    Hello world  Hello Universe
    Hello world  Hello Universe
                 Hello Universe
                 Hello Universe

</code></pre>
I have been trying to do this with nested lists; I learned a lot about lists but I start to doubt that nested lists is not the right method. I appreciate it if you suggest better alternatives. Thanks.
======
zeynel1
Link to SO discussion:
[http://stackoverflow.com/questions/4011728/conditional-
state...](http://stackoverflow.com/questions/4011728/conditional-statements-
with-python-lists)

