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