Sobes.tech
Junior — Senior

String decomposition using the * operator

livecode

Task condition

The example shows a fragment of Python code where a string is split into individual elements using the * operator. The string 'stepik' is distributed among the variables x, y, and z, after which the value of y is printed. Indicate what output will appear on the screen. Answer options:

  • epik
  • epi
  • ['e', 'p', 'i', 'k']
  • ['t', 'e', 'p', 'i']
  • an error will occur
  • ['s', 't', 'e', 'p']
x, *y, z = 'stepik'
print(y)