title: Beginner Python script for calculating GC content in DNA sequence
body: <p>I'm trying to calculate the GC content (in %) of a DNA sequence for a Rosalind question. I have the following code, but it returns 0, or only the number of G's alone or C's alone (no percentage).</p>
  
  <pre><code>x = raw_input("Sequence?:").upper()
  total = len(x)
  c = x.count("C")
  g = x.count("G")
  
  gc_total = g+c
  
  gc_content = gc_total/total
  
  print gc_content
  </code></pre>
  
  <p>I also tried this, just to get a count of G's and C's, and not the percentage, but it just returns a count of the entire string:</p>
  
  <pre><code>x = raw_input("Sequence?:").upper()
  def gc(n):
      count = 0
      for i in n:
          if i == "C" or "G":
              count = count + 1
          else:
              count = count
      return count
  gc(x)
  </code></pre>
  
  <p>EDIT: I fixed the typo in the print statement in the first example of code. That wasn't the problem, I just pasted the wrong snippet of code (there were many attempts...)</p>