Apart from that there are a lot of mistakes (e.g. tip([1])) and redundancies (e.g. wrapping everything in parenthesis) in your code. You should probably read the the MicroPython and Pin documentation first.