This is my code, for calculating a GPA for 7 subjects. It works, but is there a better way? Any hints on making it more flexible?

```
from __future__ import division

import string

print "This program will calculate a Semester GPA for a given set of courses. Enter 0 in all inputs, if you want to skip extra courses.\n"

cname1 = raw_input("First course name: ")

while True:
    cred1 = raw_input("First course credit: ")
    try:
        i = int(cred1)
        break
    except ValueError:
        print 'Invalid input, Should be an positive interger'

grade1 = raw_input("First course grade: ")

choice1 = grade1

while choice1 not in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]:

    print 'Invalid choice'

    grade1 = raw_input("First course grade: ")

    users_turn = choice1 in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]

    choice1 = grade1

cname2 = raw_input("Second course name: ")

while True:
    cred2 = raw_input("Second course credit: ")
    try:
        i = int(cred2)
        break
    except ValueError:
        print 'Invalid input, Should be an positive interger'

grade2 = raw_input("Second course grade: ")

choice2 = grade2

while choice2 not in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]:

    print 'Invalid choice'

    grade2 = raw_input("Second course grade: ")

    users_turn = choice2 in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]

    choice2 = grade2

cname3 = raw_input("Third course name: ")

while True:
    cred3 = raw_input("Third course credit: ")
    try:
        i = int(cred3)
        break
    except ValueError:
        print 'Invalid input, Should be an positive interger'

grade3 = raw_input("Third course grade: ")

choice3 = grade3

while choice3 not in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]:

    print 'Invalid choice'

    grade3 = raw_input("Third course grade: ")

    users_turn = choice3 in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]

    choice3 = grade3

cname4 = raw_input("Fourth course name: ")

while True:
    cred4 = raw_input("Fourth course credit: ")
    try:
        i = int(cred4)
        break
    except ValueError:
        print 'Invalid input, Should be an positive interger'

grade4 = raw_input("Fourth course grade: ")

choice4 = grade4

while choice4 not in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]:

    print 'Invalid choice'

    grade4 = raw_input("Fourth course grade: ")

    users_turn = choice4 in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]

    choice4 = grade4

cname5 = raw_input("Fifth course name: ")

while True:
    cred5 = raw_input("Fifth course credit: ")
    try:
        i = int(cred5)
        break
    except ValueError:
        print 'Invalid input, Should be an positive interger'

grade5 = raw_input("Fifth course grade: ")

choice5 = grade5

while choice5 not in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]:

    print 'Invalid choice'

    grade5 = raw_input("Fifth course grade: ")

    users_turn = choice5 in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]

    choice5 = grade5

cname6 = raw_input("Sixth course name: ")

while True:
    cred6 = raw_input("Sixth course credit: ")
    try:
        i = int(cred6)
        break
    except ValueError:
        print 'Invalid input, Should be an positive interger'

grade6 = raw_input("Sixth course grade: ")

choice6 = grade6

while choice6 not in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]:

    print 'Invalid choice'

    grade6 = raw_input("Sixth course grade: ")

    users_turn = choice6 in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]

    choice6 = grade6

cname7 = raw_input("Seventh course name: ")

while True:
    cred7 = raw_input("Seventh course credit: ")
    try:
        i = int(cred7)
        break
    except ValueError:
        print 'Invalid input, Should be an positive interger'

grade7 = raw_input("Seventh course grade: ")

choice7 = grade7

while choice7 not in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]:

    print 'Invalid choice'

    grade7 = raw_input("Seventh course grade: ")

    users_turn = choice7 in ["A+", "a+", "A", "a","A-", "a-", "B+", "b+", "B", "b", "B-", "b-", "C+", "c+", "C", "c","C-", "c-", "D+", "d+", "D", "d", "D-", "d-", "FAIL", "fail"]

    choice7 = grade7

totalGPA = 0.0

overallGPA = 0.0

cred1i = string.atoi(cred1)

cred2i = string.atoi(cred2)

cred3i = string.atoi(cred3)

cred4i = string.atoi(cred4)

cred5i = string.atoi(cred5)

cred6i = string.atoi(cred6)

cred7i = string.atoi(cred7)

if grade1 in {"A+", "a+", "A", "a"}:

    c1points = (4.0*cred1i)

elif grade1 in {"A-", "a-"}:

    c1points = (3.67*cred1i)

elif grade1 in {"B+", "b+"}: 

    c1points = (3.33*cred1i)

elif grade1 in {"B", "b"}:

    c1points = (3.0*cred1i)

elif grade1 in {"B-", "b-"}:

    c1points = (2.67*cred1i)

elif grade1 in {"C+", "c+"}:

    c1points = (2.33*cred1i)

elif grade1 in {"C", "c"}:

    c1points = (2.0*cred1i)

elif grade1 in {"C-", "c-"}:

    c1points = (1.67*cred1i)

elif grade1 in {"D+", "d+"}:

    c1points = (1.33*cred1i)

elif grade1 in {"D", "d"}:

    c1points = (1.0*cred1i)

else:

    c1points = 0.0

if grade2 in {"A+", "a+", "A", "a"}:

    c2points = (4.0*cred2i)

elif grade2 in {"A-", "a-"}:

    c2points = (3.67*cred2i)

elif grade2 in {"B+", "b+"}: 

    c2points = (3.33*cred2i)

elif grade2 in {"B", "b"}:

    c2points = (3.0*cred2i)

elif grade2 in {"B-", "b-"}:

    c2points = (2.67*cred2i)

elif grade2 in {"C+", "c+"}:

    c2points = (2.33*cred2i)

elif grade2 in {"C", "c"}:

    c2points = (2.0*cred2i)

elif grade2 in {"C-", "c-"}:

    c2points = (1.67*cred2i)

elif grade2 in {"D+", "d+"}:

    c2points = (1.33*cred2i)

elif grade2 in {"D", "d"}:

    c2points = (1.0*cred2i)

else:

    c2points = 0.0

if grade3 in {"A+", "a+", "A", "a"}:

    c3points = (4.0*cred3i)

elif grade3 in {"A-", "a-"}:

    c3points = (3.67*cred3i)

elif grade3 in {"B+", "b+"}: 

    c3points = (3.33*cred3i)

elif grade3 in {"B", "b"}:

    c3points = (3.0*cred3i)

elif grade3 in {"B-", "b-"}:

    c3points = (2.67*cred3i)

elif grade3 in {"C+", "c+"}:

    c3points = (2.33*cred3i)

elif grade3 in {"C", "c"}:

    c3points = (2.0*cred3i)

elif grade3 in {"C-", "c-"}:

    c3points = (1.67*cred3i)

elif grade3 in {"D+", "d+"}:

    c3points = (1.33*cred3i)

elif grade3 in {"D", "d"}:

    c3points = (1.0*cred3i)

else:

    c3points = 0.0

if grade4 in {"A+", "a+", "A", "a"}:

    c4points = (4.0*cred4i)

elif grade4 in {"A-", "a-"}:

    c4points = (3.67*cred4i)

elif grade4 in {"B+", "b+"}: 

    c4points = (3.33*cred4i)

elif grade4 in {"B", "b"}:

    c4points = (3.0*cred4i)

elif grade4 in {"B-", "b-"}:

    c1points = (2.67*cred4i)

elif grade4 in {"C+", "c+"}:

    c4points = (2.33*cred4i)

elif grade4 in {"C", "c"}:

    c4points = (2.0*cred4i)

elif grade4 in {"C-", "c-"}:

    c1points = (1.67*cred4i)

elif grade4 in {"D+", "d+"}:

    c4points = (1.33*cred4i)

elif grade4 in {"D", "d"}:

    c4points = (1.0*cred4i)

else:

    c4points = 0.0

if grade5 in {"A+", "a+", "A", "a"}:

    c5points = (4.0*cred5i)

elif grade5 in {"A-", "a-"}:

    c5points = (3.67*cred5i)

elif grade5 in {"B+", "b+"}: 

    c5points = (3.33*cred5i)

elif grade5 in {"B", "b"}:

    c5points = (3.0*cred5i)

elif grade5 in {"B-", "b-"}:

    c5points = (2.67*cred5i)

elif grade5 in {"C+", "c+"}:

    c5points = (2.33*cred5i)

elif grade5 in {"C", "c"}:

    c5points = (2.0*cred5i)

elif grade5 in {"C-", "c-"}:

    c5points = (1.67*cred5i)

elif grade5 in {"D+", "d+"}:

    c5points = (1.33*cred5i)

elif grade5 in {"D", "d"}:

    c5points = (1.0*cred5i)

else:

    c5points = 0.0

if grade6 in {"A+", "a+", "A", "a"}:

    c6points = (4.0*cred6i)

elif grade6 in {"A-", "a-"}:

    c6points = (3.67*cred6i)

elif grade6 in {"B+", "b+"}: 

    c6points = (3.33*cred6i)

elif grade6 in {"B", "b"}:

    c6points = (3.0*cred6i)

elif grade6 in {"B-", "b-"}:

    c6points = (2.67*cred6i)

elif grade6 in {"C+", "c+"}:

    c6points = (2.33*cred6i)

elif grade6 in {"C", "c"}:

    c6points = (2.0*cred6i)

elif grade6 in {"C-", "c-"}:

    c6points = (1.67*cred6i)

elif grade6 in {"D+", "d+"}:

    c6points = (1.33*cred6i)

elif grade6 in {"D", "d"}:

    c6points = (1.0*cred6i)

else:

    c6points = 0.0

if grade7 in {"A+", "a+", "A", "a"}:

    c7points = (4.0*cred7i)

elif grade7 in {"A-", "a-"}:

    c7points = (3.67*cred7i)

elif grade7 in {"B+", "b+"}: 

    c7points = (3.33*cred7i)

elif grade7 in {"B", "b"}:

    c7points = (3.0*cred7i)

elif grade7 in {"B-", "b-"}:

    c7points = (2.67*cred7i)

elif grade1 in {"C+", "c+"}:

    c7points = (2.33*cred7i)

elif grade7 in {"C", "c"}:

    c7points = (2.0*cred7i)

elif grade7 in {"C-", "c-"}:

    c7points = (1.67*cred7i)

elif grade7 in {"D+", "d+"}:

    c7points = (1.33*cred7i)

elif grade7 in {"D", "d"}:

    c7points = (1.0*cred7i)

else:

    c7points = 0.0

totalCredits = cred1i+cred2i+cred3i+cred4i+cred5i+cred6i+cred7i

overallGPA = (c1points + c2points + c3points + c4points + c5points + c7points + c7points)/totalCredits

cname1 = cname1.ljust(15)

cred1 = cred1.center(9)

grade1 = grade1.center(6)

cname2 = cname2.ljust(15)

cred2 = cred2.center(9)

grade2 = grade2.center(6)

cname3 = cname3.ljust(15)

cred3 = cred3.center(9)

grade3 = grade3.center(6)

cname4 = cname4.ljust(15)

cred4 = cred4.center(9)

grade4 = grade4.center(6)

cname5 = cname5.ljust(15)

cred5 = cred5.center(9)

grade5 = grade5.center(6)

cname6 = cname6.ljust(15)

cred6 = cred6.center(9)

grade6 = grade6.center(6)

cname7 = cname7.ljust(15)

cred7 = cred1.center(9)

grade7 = grade7.center(6)

print "COURSE         CREDITS  GRADE \n"

print "------         -------  ----- \n"

print '%s%s%s' % (cname1, cred1, grade1)

print '%s%s%s' % (cname2, cred2, grade2)

print '%s%s%s' % (cname3, cred3, grade3)

print '%s%s%s' % (cname4, cred4, grade4)

print '%s%s%s' % (cname5, cred5, grade5)

print '%s%s%s' % (cname6, cred6, grade6)

print '%s%s%s' % (cname7, cred7, grade7)

print "SEMESTER GPA = %.2f" % (overallGPA)

```