Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to write IS NOT for str.endswith in python [closed]

Tags:

How to write something like !(str.endswith()) in python I mean I want to check if string IS NOT ending with something. My code is

if text == text. upper():   and text.endswith("."):

But I want to put IS NOT after and writing

if text == text. upper():   and not text.endswith("."):

or

if text == text. upper():   and not(text.endswith(".")):

gives me Invalid syntax


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!