Category "os.walk"

Create a zip with only .pdf and .xml files from one directory

I would love to know how i can zip only all pdfs from the main directory without including the subfolders. I've tried several times changing the code, without a

ZIp only contents of directory, exclude parent

I'm trying to zip the contents of a directory, without zipping the directory itself, however I can't find an obvious way to do this, and I'm extremely new to py