title: for loop inside if condition
body: <pre><code>print "Select the action you want to perform(A or B)"
  print "(A) uppper case"
  print "(B) count number of lines"
  
  option = raw_input("Enter your option(A or B):")
  
  if option.upper() == "A":
      for line in x:
          line = line.upper()
  
      print line
  
  
  elif option.upper() == "B":
      for line in x:
          line = line.upper()
          count = count + 1
      print "total lines:", count
  
  else:
      print "incorrect option"
      exit()
  </code></pre>
  
  <p>When user enters <strong>A</strong> it prints only one line(last line) in upper case instead of 250 lines. </p>
  
  <p>count works perfectly. </p>
  
  <hr>
  
  <p>P.S. I have not submitted the first part of code which is for input of file name to be opened. </p>