Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- path = input()
- path_split = path.split("\\")
- path_file_name_ext = path_split[-1]
- path_file_name_ext_split = path_file_name_ext.split(".")
- file_name = path_file_name_ext_split[0]
- extension = path_file_name_ext_split[1]
- print(f"File name: {file_name}")
- print(f"File extension: {extension}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement