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_2 : int ) -> str :
      for var_5 , var_6 in enumerate ( var_0 ) :
          if var_6 == ' ' :
              var_2 -= 1
          if var_2 == 0 :
              return var_0 [ : var_5 ]
      return var_0
  