Is there any way to do this in a single line, but without using a 'None'?:
folders = ['Project 1', 'Project 2']
files = os.listdir('/home/user/Documents/Python')
for i in files:
files.remove(i) if i in folders else None
Could one 'skip' the 'else' statement?
Thanks in advance.
files = [_ for _ in files if _ not in folders], the Python style._is only for unused variables._unless it is a throwaway variable, which it is not.