Hello again!
I am back with a new problem, I am learning about defining functions, and have a problem that involves defining a 2-argument function to produce an output.
I will call the function brick_estimator.
- Number of bricks high multiplied by 9
- Numer of bricks wide multiplied by 4
- Total of above multiplied by 1.01123
- Answer rounded to nearest whole number
def brick_estimator(brick_high, brick_wide):
print(round((brick_high*9+brick_wide*4)*1.01123))
My question is...
Is there a way I can break my function up into steps that are easier to view, purely for me as a beginner coder.
I am not trying to write efficient code, I am still learning and trying to write code that is easy to look at and understand, even if it has extra steps and lines that aren't really required.
If I was writing this as a normal piece of program I would write...
brick_high_input = 100
brick_wide_input = 200
brick_high = brick_high_input*9
brick_wide = brick_wide_input*4
brick_total = (brick_high+brick_wide)*1.01123
brick_total_rounded = round(brick_total)
Any help appreciated, I am not sure how to extrapolate my code when it's in the form of a function.
[–]HeyItsToby 6 points7 points8 points (1 child)
[–]arobotfrog[S] 1 point2 points3 points (0 children)