Referring to the question above, is there a way to identify how many arguments are passed to a function.
def setup(file1, file2):
reader1 = PyPDF2.PdfFileReader(file1)
reader2 = PyPDF2.PdfFileReader(file2)
My goal is to make the function versatile. My plan is to detect how many arguments are passed and then modify the behavior of the function such as, if three files are passed to the function, it will create 3 readers. I'll use for
loop to name the readers and pass the right files to the PdfFileReader()
function. But, I just do not know how to make the function behave like how I want it to be in the first place.