I've been trying this code but I keep getting the same result, which is:
if Prep.endswith ('jpg'): AttributeError:'NoneType' object has no attribute 'endswith'
import re
result = "hey(14).jpg"
Prep = print(re.sub(r" ?\([^)]+\)", "", result))
if Prep.endswith ('jpg'):
Caption = print(Prep.replace("jpg", "is jpg"))
elif Prep.endswith ('png'):
Caption = print(Prep.replace("png", "is png"))
elif Prep.endswith ('gif'):
Caption = print(Prep.replace("gif", "is gif"))
else :
Caption = print("Unknown")
I dont know where this comes from.
Any help will be apreciated.
Cheers.