[email protected] wrote:
I want to know how to use multiple parameters for 1 function


def display(message):
        print message

def rate_score():
    score =ate_score
if rate_score <=99:
    print "that's nothing."
elif rate_score <=0000:
    print "ok."
elif rate_score >=0000: print "great."
#main           

display("Get  the meaning !")

raw_input("Please type in your score")
print "here's your score", rate_score
rate_score()
This is the outcome:

great.
Get the meaning
Please type in your score50
here's your score <function rate_score at 0x025610F0>


I have no idea what the subject line is supposed to mean, but that program is in sad shape. It won't compile and run as it stands, so I suspect you didn't transcribe it correctly. Please use cut and paste to show us what you really have, and what it really produces. Then maybe we can comment on improvements.

Also, please delineate which parts of the message are from a python script, and which parts are the echoes from an interactive run. And if you're running from a command line, show the command used to launch the script, all the way through to the end.

One thing that probably isn't a transcribing error is your total confusion between a variable called rate_score and a function by the same name. A given name can only have one meaning in one scope, so plan carefully. And even if you can reassign a function name inside that function to have a new value, it's almost never a good idea. For one thing, it makes it hard to call the function a second time.

DaveA
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to