Ad

Ping pong

Code
Diff
  • def oddEven(n):
        switch=[True,False]
        bool=True
        for i in range (n):
            bool=not bool
        return switch[bool]
    • def oddEven(n):
    • return not str(n)[-1] in "02468"
    • switch=[True,False]
    • bool=True
    • for i in range (n):
    • bool=not bool
    • return switch[bool]