comefrom: <doocs>1816.Truncate Sentence_1.py
code: def truncateSentence( s: str, k: int) -> str:
      for i, c in enumerate(s):
          if c == ' ':
              k -= 1
          if k == 0:
              return s[:i]
      return s
masked: def sample_funcname ( var_0 : str , var_1 : int ) -> str :
      for var_2 , var_3 in enumerate ( var_0 ) :
          if var_3 == ' ' :
              var_1 -= 1
          if var_1 == 0 :
              return var_0 [ : var_2 ]
      return var_0
  