## convert from Centimeters to Yards, Feet and Inches

inCm = float(input(“How many centimeters do you want to convert? “)) yards = inCm // 91.44 left = (inCm / 91.44) – yards inCm = left * 91.44 feet = inCm // 30.48 left = (inCm / 30.48) – feet inCm = left * 30.48 inches = inCm / 2.54 print(“This is”,int(yards),”yards,”,int(feet),”feet,”,inches,”inches”)

## convert from lbs to gallons and ounces

lbs = float(input(“Plase enter the lbs of water treated: “)) ounces = lbs * 16 gallons = int(ounces / 128) ounces = ounces – gallons * 128 print(“That’s”,gallons,”gallons and”,ounces,”ounces of treated waste water.”)

## Total File Size

import os def main(): path = input(“Enter a directory or a file: “).strip() try: print(getSize(path), “bytes”) except: print(“Directory or file does not exist”) def getSize(path): size = 0 if not os.path.isfile(path): lst = os.listdir(path) for subdirectory in lst: size += getSize(path + “\\” + subdirectory) else: size += os.path.getsize(path) return size main()

## Recursive Binary Search

import os def main(): path = input(“Enter a directory or a file: “).strip() try: print(getSize(path), “bytes”) except: print(“Directory or file does not exist”) def getSize(path): size = 0 if not os.path.isfile(path): lst = os.listdir(path) for subdirectory in lst: size += getSize(path + “\\” + subdirectory) else: size += os.path.getsize(path) return size main()