def file_ext(filename):
 dot_index = filename.find('.')
 if (dot_index == (-1)):
  return ''
 return filename[dot_index:]

def file_ext ( filename ) : dot_index = filename . find ( '.' ) if ( dot_index == ( - 1 ) ) : return '' return filename [ dot_index : ]
return the file extension .