arrays - Vertically flip ASCII art with Python -


for code working on, need vertically flip ascii image: want make this:

     *     ***    *****     ***     *** 

into this:

    ***     ***    *****     ***      * 

all have right read input on multiple lines array, how make prints first array last , bottom array first.

text = "" stopword = "" while true:     line = input()     if line.strip() == stopword:         break 

you can add each line list of lines (list.append) , invert list (list[::-1]) before printing:

lines = [] stopword = "" while true:     line = input()     if line.strip() == stopword:         break     lines.append(line) # add list of lines line in lines[::-1]: # [::-1] inverts list     print(line) 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -