I'm writing a printer calculator program. I want to take a "parent sheet" divide it into "run sheets" and then the runs into finish sheets. The size of parent, run and finish are input by the user.
There are other variables to be added later, like gutter and paper grain, but for now I just want to divide rectangles by rectangles. Here's my first crack:
import math
def run_number(p_width, p_height, r_width, r_height):
numb_across = p_width/r_width
numb_up = p_height/r_height
run_numb = numb_up * numb_across
print math.trunc(run_numb)
def print_number(f_width, f_height, r_width, r_height):
numb_across = r_width/f_width
numb_up = r_height/f_height
finish_numb = numb_up * numb_across
print math.trunc(finish_numb)
#Parent size
p_width = input("Parent Width: ")
p_height = input("Parent Height: ")
#Run size
r_width = input("Run Width: ")
r_height = input("Run Height: ")
#finish size
f_width = input("Finish Width: ")
f_height = input("Finish Height: ")
run_number(p_width, p_height, r_width, r_height)
print_number(f_width, f_height, r_width, r_height)
Am I using the arguments correctly? It seems wrong to create variables, pass those variables as arguments, then use those argument values. But, how I would I do this better?
The input call is outside the functions, but I'm using the same variable name (p_width, p_height, etc.), as I'm using inside the function. I don't think this is breaking this program, but I can't believe it's good practice.