"Robert Sjöblom" wrote
On a related note, do all functions implicitly contain "return None"
in them?
All functions return a value because thats the definition of what
a function does. (Some languages have a construct known as
a procedure which is a function with no return value, but Python
do
On Mon, Nov 29, 2010 at 8:28 PM, Robert Sjöblom wrote:
>
>
> On a related note, do all functions implicitly contain "return None"
> in them? Trying out this function (correctly) would get "None" added,
> such as:
> Enter grade:76
> B, Try Harder
> None
>
> Is there a way to avoid "return None" wi
>> Write a code that will take an input from a user (numerical grade) and
>> convert their numerical grade into a letter grade that is accompanied by a
>> ?smart? statement.
>>
>> def grade_score(grade):
>>
>> if grade >=95 and grade <= 100:
>>
>> print 'A+, Excellent'
>>
>> elif
On Sun, Nov 28, 2010 at 6:50 PM, Andre Jeyarajan
wrote:
> Write a code that will take an input from a user (numerical grade) and
> convert their numerical grade into a letter grade that is accompanied by a
> “smart” statement.
>
> def grade_score(grade):
>
> if grade >=95 and grade <= 100:
>
Write a code that will take an input from a user (numerical grade) and convert
their numerical grade into a letter grade that is accompanied by a “smart”
statement. def grade_score(grade):
if grade >=95 and grade <= 100:
print 'A+, Excellent'
elif grade >=85 and grade < 95: