$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · hard · #121

What is printed?

print([x for x in 'abc'], [x for x in ''])
  1. ['a', 'b', 'c'] []
  2. ['abc'] []
  3. ['a', 'b', 'c'] ['']
  4. 'abc' ''
Iterating a string yields its characters; an empty string yields nothing.
Play Problem Solving ▸