title: How to skip lines in Python
body: <p>I am having trouble with this problem on Computer Circles, I know that it is probably a very simple exercise but well, guess I have a lot to learn. </p>
  
  <p>The problem arises when nothing is inputted in one of the inputs. The last input is a <code>"END"</code> so I wanted to create some way to skip the other inputs (think <code>goto</code>) in order to prevent an error. </p>
  
  <p>I would appreciate any suggestions for optimization/structuring improvements.</p>
  
  <p>Thank you in advance.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>width = int(input())
  second = input()
  third = input()
  fourth = input()
  fifth = input()
  sixth = input()
  
  
  lenght_of_second = len(second)
  lenght_of_third = len(third)
  lenght_of_fourth = len(fourth) 
  lenght_of_fifth = len(fifth)
  lenght_of_sixth = len(sixth)
  
  
  periods = width - lenght_of_second 
  
  periods_on_side = periods // 2
  reminder_periods = periods % 2
  if second != "END":
     print("." * reminder_periods + "." * periods_on_side + second + periods_on_side * "." )
  
  
  
  
  
  
  periods = width - lenght_of_third 
  
  periods_on_side = periods // 2
  reminder_periods = periods % 2
  if third != "END":
     print("." * reminder_periods + "." * periods_on_side + third + periods_on_side * "." )
  
  
  
  
  periods = width - lenght_of_fourth
  
  periods_on_side = periods // 2
  reminder_periods = periods % 2
  if fourth != "END":
     print("." * reminder_periods + "." * periods_on_side + fourth + periods_on_side * "." )
  
  
  
  
  periods = width - lenght_of_fifth 
  
  periods_on_side = periods // 2
  reminder_periods = periods % 2
  if fifth != "END":
     print("." * reminder_periods + "." * periods_on_side + fifth + periods_on_side * "." )
  
  
  
  
  periods = width - lenght_of_sixth
  
  periods_on_side = periods // 2
  reminder_periods = periods % 2
  if sixth != "END":
     print("." * reminder_periods + "." * periods_on_side + sixth + periods_on_side * "." )
  </code></pre>
  
  <p>For this program, the first line of input is an integer width. Then, there are some lines of text; the line <code>"END"</code> indicates the end of the text. </p>
  
  <p>For each line of text, you need to print out a centered version of it, by adding periods <code>..</code> to the left and right, so that the total length of each line of text is width. (All input lines will have length at most width.) </p>
  
  <p>Centering means that the number of periods added to the left and added to the right should be equal if possible; if needed we allow one more period on the left than the right. </p>
  
  <p><strong>For example, for input:</strong></p>
  
  <pre><code>13
  Text
  in
  the
  middle!
  END  
  </code></pre>
  
  <p><strong>the correct output would be</strong></p>
  
  <pre><code>.....Text....
  ......in.....
  .....the.....           
  ...middle!...
  </code></pre>