Open this example in the interactive library
Source code
print('report.csv'.removesuffix('.csv'))Sample output
report

Remove an exact suffix. A self-contained example using the Python standard library.
Open this example in the interactive library
print('report.csv'.removesuffix('.csv'))report