code: def pretty_bytes(num):
      
      for unit in ['', 'KB', 'MB', 'GB']:
          if num < 1024.0:
              if unit == '':
                  return "%d" % (num)
              else:
                  return "%3.1f%s" % (num, unit)
          num /= 1024.0
      return "%3.1f%s" % (num, 'TB')
docs: pretty print the given number of bytes