python 中 if语句取反

 

001、

>>> str1 = ">aabbcc"
>>> if str1.startswith(">"):
...     print("yes")
...
yes
>>> if not str1.startswith(">"):    ## python中if语句取反
...     print("yes")
...

 

posted @ 2022-11-02 16:24  小鲨鱼2018  阅读(498)  评论(0编辑  收藏  举报