I'm trying to remove the .png part of a filename using remove suffix
'x.png'.removesuffix('.png')
But it keeps returning:
AttributeError: 'str' object has no attribute 'removesuffix'
I've tried some other string functions but I keep getting 'str' object has no attribute ' '. What should I do to fix this?