this is the code i have written. but everytime all files are moving to 'images' folder. even in debugger,variables are all showing true values,but files are not moving according to if conditions
from os import mkdir,path,chdir,listdir
from shutil import move
filedirectory = '/root/Downloads'
chdir(filedirectory)
types = ['images','pdf','windows executables','linux tools','other scripts']
for type in types:
if not path.exists(type):
mkdir(type)
files=listdir()
for file in files:
if path.isfile(file):
lists = []
lists = file.split('.')
extension = lists[-1]
if extension == 'jpg' or 'jpeg' or 'png':
move(file,'images')
elif extension == 'exe':
move(file,'windows executables')
elif extension == 'xz' or 'gz':
move(file,'linux tools')
elif extension == 'py' or 'rb':
move(file,'other sripts')
elif extension == 'pdf':
move(file,'pdf')