On Fri, 07 Dec 2007 09:37:22 +0100, Lars Johansen wrote:
> I have a function that looks like this:
>
> def Chooser(color):
>
> if color == "RED":
> x = term.RED
[snip]
> Wouldn there been easier if I could just skip all the "*if's" and just
> "return term.color", however
Lars Johansen wrote:
> I have a function that looks like this:
>
> def Chooser(color):
>
> if color == "RED":
> x = term.RED
> elif color == "BLUE":
> x = term.BLUE
> elif color == "GREEN":
> x = term.GREEN
> elif col
Lars Johansen a écrit :
> I have a function that looks like this:
>
> def Chooser(color):
Bad naming (noun instead of a verb) and not conformant to PEP 08
(function names should be all_lower)
> if color == "RED":
> x = term.RED
> elif color == "BLUE":
>
On Dec 7, 10:37 am, Lars Johansen <[EMAIL PROTECTED]> wrote:
> I have a function that looks like this:
>
> def Chooser(color):
>
> if color == "RED":
> x = term.RED
> elif color == "BLUE":
> x = term.BLUE
> elif color == "GREEN":
>
On Dec 7, 9:37 am, Lars Johansen <[EMAIL PROTECTED]> wrote:
> I have a function that looks like this:
>
> def Chooser(color):
>
> if color == "RED":
> x = term.RED
> elif color == "BLUE":
> x = term.BLUE
> elif color == "GREEN":
>
Lars Johansen wrote:
> I have a function that looks like this:
>
> def Chooser(color):
>
> if color == "RED":
> x = term.RED
> elif color == "BLUE":
> x = term.BLUE
> elif color == "GREEN":
> x = term.GREEN
> elif col
I have a function that looks like this:
def Chooser(color):
if color == "RED":
x = term.RED
elif color == "BLUE":
x = term.BLUE
elif color == "GREEN":
x = term.GREEN
elif color == "YELLOW":
x = term.YE