woooee 814 Nearly a Posting Maven

originally I thought it was by ascii value, but then 11 would have been the min value since ascii 1 is lower than ascii 7.

11 is only less than 7 on the planet Bizarro, and any number AFAIK is sorted before letters so they are all first, because any digit is less than any character. Note that there is a difference between 11 (decimal 11) and '11' (decimal 49, decimal 49) and they will be sorted differently.

woooee 814 Nearly a Posting Maven

Instead of
self.hours=credits. do you want to total them
self hours += credits

woooee 814 Nearly a Posting Maven

How does Python handle mixed type lists to get such a result?

Pretty much, all pc's use ascii encoding and sort in "ascii order", see http://www.asciitable.com/

woooee 814 Nearly a Posting Maven
def main():
        grade_str = raw_input("Enter gradepoint or (Enter to quit): ")
        if grade_str == "":
            break
        try:
            grade = float(grade_str)
        except ValueError:
            print "Error, use floating point number"
            return

You want the "try :" statement as the first statement after "while 1:". That will give you an error message if a number is not entered. If an integer is entered, it can legally be type cast into a float. If a float is entered and you try to convert it into an integer you will get an error, so inserting a "grade_int = int(grade_str) and another try:/except: statement will do the trick, but it seems cumbersome. You could also use divmod(grade_float, 1) and check for a remainder. Can someone legimately have a gpa of 70? If so you want to be able to enter an integer. If the gpa is entered as 0.70, then you want to test that the float is less than one.

while 1:
     try:
        print
        grade_str = raw_input("Enter gradepoint or (Enter to quit): ")
        if grade_str == "":
            break
        grade = float(grade_str)
        try :
           grade_int = int(grade_str)
           print "Error, use floating point number"
        except :
           print grade
     except ValueError:
            print "Error, use floating point number"

Edit: Added additional try/except statement. Sorry, I did the first post in a hurry.
Edit-2: I would suggest that you have a GetInput function that you would pass "grade point" or "credit hours" to, it would get the input and convert to floating point and return the number …

woooee 814 Nearly a Posting Maven

File "C:\Python23\p2sort.py", line 40, in main
if dfield == gpa:
NameError: global name 'gpa' is not defined

I think you want "gpa" in quotes.
if dfield == "gpa":
A simple menu would be easier for the user, with 1=gpa, etc. In any case, you should have a list of correct responses, or be able to add something like 0 < number < 4, to check for a valid input.

woooee 814 Nearly a Posting Maven

Let's take fib(7)

fib(7) = 13 = 8 + 5 (curr/ prev)

fib(6) = 8 = 5 + 3 (curr/ prev)

fib(5) = 5 = 3 + 2 (curr/ prev )
I am realizing I need to store some things here but I'm not sure what or how, right now.
1 1 2 3 5 8 13

Perhaps append a fib sequence to a list until the value is greater than the input number? That should give you the info. If you want to use recursion, you can use it to calculate the fib list. Personally, I would use a while loop, but whatever.

woooee 814 Nearly a Posting Maven

Not sure if this is what you want to do or not, but try replacing

else:
        value = fib(n-1)+fib(n-2)
## with
   else:
        value = fib(n-1)

You might also want to use a list to store the two fib numbers, since fibs are not sequential. Again, not sure what you are trying to do.

woooee 814 Nearly a Posting Maven

Recursion usually means something that calls itself. The following is a link to a sort that uses recursion. Note that in the sort there is a way to tell if the item has already been tested/done. Recursion is used for things like sorts and walking a directory to get files from subdirectories.
http://www.faqts.com/knowledge_base/view.phtml/aid/4491

##Recursion to compute a factorial
def factorial(n) :
   if n < 2 :
      return 1
   else :
      return ( n * factorial(n-1) )
woooee 814 Nearly a Posting Maven

I cannot get my return of the Fibonacci number to work properly and when I ran this program with fib(10) it ran forever.

'Ran forever' because you are calculating using the same number over and over. Look at your output. If you want to compute a fib you first have to start with two numbers. The sequence 1, 1, 2, 3, 5 actually starts with zero and one. You can start with any two numbers you want, or with one number and number-1, so if we start with 10 and 10-1=9, store those two numbers in a list, pass the list to the function which adds them together, then element[0] = element[1], and element[1] = the sum, and continue by returning the updated list. If you still can't figure it out, post back. When testing a loop, it is a good idea to put in a counter and if it is greater than some number, say 1000, exit with an error message.

Edit: I'm now wondering if you want to calculate the fibs used to calculate a number. I would think that mpossible as it can be any two numbers in combination. For example 10=9+1 or 8+2, etc. If you can explain what you want to do in words or have some math, please post back.

woooee 814 Nearly a Posting Maven

You can use type()

x = random.randint(0,10)
y = random.randint(0,10)
li = [1,2]
li2 = [x,y]

test_list = []
if every_value of li2 is in li:
    if type(every_value) == type(test_list) :
       do this

Note that 'of li2 is in li' will compare entire list to list, not each element, assuming every_value is a list. It is not considered good code practice to use the letters 'el', 'eye', or 'oh' for variable names as they look too much like numbers and are confusing.