python-crash-course/Chapter_02/2-8_fileExtensions.py
2025-01-20 16:39:02 -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'))