[Tutor] writing function changeColor
Steven D'Aprano
steve at pearwood.info
Wed Jul 18 22:42:12 CEST 2012
Aditi Pai wrote:
> Emile,
>
> So far I have started with
>
> def changeColor(pict,scale,color):
>
> I was told to make different names for the float and integer (float = scale
> and color= integer) and then I kept everything else the same, just to test
> it out and see if that would work.
>
> So it looks like this:
>
> def changeColor(pict,scale,color):
> for p in getPixels(pict):
> value=getRed(p)
> setRed(p,value*.9)
>
> Unfortunately I keep getting this error message:
>
> The error was:changeColor() takes at least 3 arguments (1 given)
Is this error message not clear? You have written a function that requires at
least 3 values, but you have only given 1 value.
I can't tell you what argument you have given, because you have not told us
what you have done to get this error message.
Aditi, we want to help you, but you're not giving us enough information to go
on. You're wasting our time, and your own.
Instead of biting at poor Bob, who so far has given you the best and most
valuable advise, you should pay attention to what we are trying to teach you.
Would you rather that we just ignored you in silence?
I'm about to move away from the computer for an hour or so. When I come back,
I will try to give you some more assistance. Or somebody else may try to help.
In the meantime, I suggest you try reading this page and see if it enlightens you:
http://sscce.org/
--
Steven
More information about the Tutor
mailing list