Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andriiburka/443f2f5765bffe7ce60b84c4d0b1683a to your computer and use it in GitHub Desktop.
Save andriiburka/443f2f5765bffe7ce60b84c4d0b1683a to your computer and use it in GitHub Desktop.
def box_area_foo(a, b, c):
return (a * b) * c
def sheets_area_foo(all_sheets, one_sheet_covering):
osf_sheets_count = int(all_sheets / 3) # osf = one slash four
sheets_count = int(all_sheets - osf_sheets_count)
osf_sheets_covering = (osf_sheets_count * one_sheet_covering) / 4
sheets_covering = sheets_count * one_sheet_covering
all_sheets_covering_in_cm = osf_sheets_covering + sheets_covering
return all_sheets_covering_in_cm
def covering_percentage_foo(box_area, sheets_area):
percentage = (sheets_area / box_area) * 100
return f'You can cover {percentage:.2f}% of the box.'
# Starts here
square_side_a = float(input())
square_side_b = square_side_a
box_sides = 6
sheets = int(input())
one_sheet_covering_cm = float(input())
print(covering_percentage_foo(box_area=box_area_foo(a=square_side_a, b=square_side_b, c=box_sides), \
sheets_area=sheets_area_foo(all_sheets=sheets, \
one_sheet_covering=one_sheet_covering_cm)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment