1, if blob.pixels() >100 and blob.pixels() <300: 2, if 100 < blob.pixels() < 300: 参考: https://cn.bing.com/search?q=python+范围判断&form=QBLH&sp=-1&pq=python+范围判断&sc=0-11&qs=n&sk=&cvid=6CC776551B4242A3A7AD5C7CA88080D5