python-crash-course/Chapter_02/2-08_file_extensions.py
2025-01-22 12:32:29 -05:00

7 lines
207 B
Python

# Excercise 2-8 File Extensions
# Learning Objective: Utilize removesuffix() method. Additionally one could use removeprefix() as well.
filename = "python_notes.txt"
print(filename.removesuffix('.txt'))