$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · medium · #245

What is the output?

print(len('a  b'.split()), len('a  b'.split(' ')))
  1. 2 2
  2. 3 3
  3. 3 2
  4. 2 3
split() with no argument splits on runs of whitespace; split(' ') splits on every single space, leaving an empty string between the two spaces: ['a', '', 'b'].
Play Problem Solving ▸