separator python code example
Example 1: split string python
file='/home/folder/subfolder/my_file.txt'
file_name=file.split('/')[-1].split('.')[0]
Example 2: sep in python
import time
def count_items(items):
print('Counting ', end='', flush=True)
num = 0
for item in items:
num += 1
time.sleep(1)
print('.', end='', flush=True)
print(f'\nThere were {num} items')