print("unhappy".removeprefix("un")) # happy print("report.txt".removesuffix(".txt")) # report
removeprefix / removesuffix (3.9+)