you are viewing a single comment's thread
view the rest of the comments
[–] 65 points 11 months ago (4 children)

Is the function called is_even()?

  • source
  • hideshow 4 child comments
  • [–] 21 points 11 months ago
    def is_even(num:int) -> bool:
        if x < 0:
            x = x * (-1)
        if x == 0:
            return True
        elif x == 1:
            return False
        elif x == 2:
            return True
        elif x == 3:
            return False
        elif x == 4:
            return True
        elif x == 5:
            return False
        elif x == 6:
            return True
        elif x == 7:
            return False
    # ...
    
  • source
  • parent