def selective_len(str, max):
 res = 0
 for c in str:
  if (ord(c) < max):
   res += 1
 return res

def selective_len ( str , max ) : res = 0 for c in str : if ( ord ( c ) < max ) : res += 1 return res
return the length of str .