I didn't want my title to be too long so to clear up any confusion I'll explain better here what my code does.
It asks for the total pages of a book(PDF file in my case), and returns the page numbers in a specific order. The groups of 32 pages will each make a booklet that when all booklets are stapled together and laid one on top of the other will be a book ready for binding.
One issue with how I wrote the program is if "pages" is not a multiple of 4, then there will be extraneous pages at the end of the list (i couldn't think of a way to pop those). Another tid-bit, print_order doesn't need to be a list, it just needs to be page numbers separated by commas and I knew list items were separated by commas so having a list of ints would give me what I needed. The formula for printing a book on a single sided printer goes like this (n, f, f+1, n-1) where n is the last page, and f is the first page of each booklet/the whole book. The reason a long book needs to be broken into booklets is because if I take a stack of 100 papers and just fold the whole stack in half the spine would be too wide and the middle pages would be poking out of the cover. So using n and f as the first and last page, respectively, of smaller booklets allows me to print a whole book into something more practical.
I'm not worried about PEP formatting on this one I'm really just curious how this could be written more efficiently. I know python is extremely powerful and I'm not taking full advantage of what it has to offer. This is how I managed to organize my thoughts into doing what I required. I know that there are many out there who could do this in a much simpler way, and I just want to look those ways over so that I can improve my coding style!
pages = float(input("How many total pages is the book?" )) num_booklets = pages/32 if (pages < 32): num_booklets = 1 pages_per_booklet = int(pages/num_booklets) last_booklet = int(pages%32) f = 1 #first page of the book n = int(pages_per_booklet) #last page of the first booklet k = 1 #number of booklets completed print_order =  while (len(print_order) < pages): while ((len(print_order) < pages_per_booklet*k) and (len(print_order) < pages)): print_order.extend([n, f, f+1, n-1]) n -= 2 f += 2 k += 1 n = pages_per_booklet * k f = 1 + (pages_per_booklet*(k-1)) if ((len(print_order)+pages_per_booklet) > pages): n = int(pages) f = int(pages) - last_booklet print(print_order)