title: Vertical Print String - Python3.2
body: <p>I'm writing a script that will take as user inputed string, and print it vertically, like so:</p>
  
  <pre><code>input = "John walked to the store"
  
  output = J w t t s
           o a o h t
           h l   e o
           n k     r
             e     e
             d
  </code></pre>
  
  <p>I've written most of the code, which is as follows:</p>
  
  <pre><code>import sys
  
  def verticalPrint(astring):
      wordList = astring.split(" ")
      wordAmount = len(wordList)
  
      maxLen = 0
      for i in range (wordAmount):
          length = len(wordList[i])
          if length &gt;= maxLen:
              maxLen = length
  
      ### makes all words the same length to avoid range errors ###
      for i in range (wordAmount):
          if len(wordList[i]) &lt; maxLen:
              wordList[i] = wordList[i] + (" ")*(maxLen-len(wordList[i]))
  
      for i in range (wordAmount):
          for j in range (maxLen):
              print(wordList[i][j])
  
  def main():
      astring = input("Enter a string:" + '\n')
  
      verticalPrint(astring)
  
  main()
  </code></pre>
  
  <p>I'm having trouble figure out how to get the output correct. I know its a problem with the for loop. It's output is:</p>
  
  <pre><code>input = "John walked"
  
  output = J
           o
           h
           n
  
           w
           a
           l
           k
           e
           d
  </code></pre>
  
  <p>Any advice? (Also, I want to have the <em>print</em> command used only once.)</p>