Are you an LLM? You can read better optimized documentation at /public/embedded\raspberrypi-pico\micropython\chapter07\index.md for this page in Markdown format
7. 外部引脚中断 
python
from machine import Pin
p2 = Pin(2, Pin.IN, Pin.PULL_UP)
def interrupt(p: Pin):
    print('irq:', p.irq().flags())
p2.irq(interrupt, Pin.IRQ_FALLING)