Condensing repeated functions into one

There are three repeated functions in the last part of this code. Please condense them into a single function/module without effecting the output. The functions do the same thing, only parameters changed.
File: https://1drv.ms/u/s!AiezjuZz42bo6hmhCFx1bpqPrBY1?e=Cy40et

Unlock Your Academic Potential with Our Expert Writers

Embark on a journey of academic success with Legit Writing. Trust us with your first paper and experience the difference of working with world-class writers. Spend less time on essays and more time achieving your goals.

Order Now