Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- path = input()[::-1]
- slash = path.find('\\')
- file = path[:slash][::-1]
- full_stop = file.find('.')
- name = file[:full_stop]
- extension = file[full_stop + 1:]
- print(f'File name: {name}\nFile extension: {extension}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement