"David" <[EMAIL PROTECTED]> wrote
When I run it from the idle it works perfect, but when I run it from
a
file I get none, why is that?
score = 66
Here you directly assign a number to score
#!/usr/bin/python
score = raw_input("What is your exam score: (0-100)? ")
Here you assign a string - the result of raw_input
print getGrade(score)
But getGrade expects to get an integer so yo need to
convert score to an int either when you pass it to getGrade
or, more usually, the return value from raw_input.
Passing a string to getGrade means it never finds a match
so never returns a grade and instead falls off the bottom with
no specified return value. When this happens Python inserts
a default return value of None
HTH,
Alan G
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor