if the variable x stored a string you could count all the A's in it using x.count('A') , at least so I've heard. Let's store that number in the variable a.
a = x.count('A')
And likewise for the others.
The number of nucleotides would certainly be
and the percent of g would be
because we'd need to avoid integer division.
if you had an file open for input, stored in the variable inf you could read lines from it
for line in inf:
# do something with line
if line.startswith('>') then you'd probably want to parse the line to find the name, rank, or serial number. line.split('"') might help!
if not line.startswith('>') you'd perhaps treat it at a sequence.
If you wanted to open a fasta file you could use the file type.
inf = open('seq.fasta')
Your turn. You write some code.