Skip to main content

Posts

Showing posts with the label tile

Python - Calculate Number of Tiles Required And Total Expenditure

🐍  In Python, calculate the total cost of tile it would take to cover a floor plan of width and height, using a cost entered by the user. Solution def tile_calculator(roomlen, roomwid, tilelen, tilewid, tileprice):          if roomlen!=0 and roomwid!=0 and tilelen!=0 and tilewid!=0:                  if roomlen%tilelen==0:             notileslen = int(roomlen//tilelen)                          if roomwid%tilewid==0:                 notileswid = int(roomwid//tilewid)                          else:                 notileswid = int((roomwid//tilewid)+1)                  elif roomlen%tilewid==0:             ...