title: New to Python - Making a GPA calculator
body: <p>I'm new to python and trying to figure out how to add in a function to some programming I did already.  I wrote  (below) a bit to convert the letter grade to GPA (Grade Point Average) and want to change it so I can type in several letters and get an averaged GPA.  What I'm having trouble with is how to get it to run each input letter and then convert it into a new form; I'm thinking I have to use a "for gp in range:" sort of thing, but am pretty lost on how to start.  Any ideas? </p>
  
  <pre><code>from sys import argv
  def gp(w):
  if w.startswith("A"):
      gp= int(4)
  if w.startswith("B"):
      gp= int(3)
  if w.startswith("C"):
      gp= int(2)
  if w.startswith("D"):
      gp= int(1)  
  if w.startswith("F"):
      gp= int(0)
  if w.endswith("+"):
      return gp+0.3
  if w.endswith("-"):
      return gp-0.3
  else:
      return gp
  if __name__ == '__main__':
  grade = argv[1]
  print("%.1f" % gp(grade))
  </code></pre>