A line of text with an empty field is split and joined again. line = "a,,b, c" parts = line.split(",") print(len(parts), "-".join(parts), " a b ".split()) What does the program print?
4 a--b- c ['a', 'b']
4 a--b- c ['', 'a', 'b', '']
3 a-b- c ['a', 'b']
4 a--b-c ['a', 'b']
Log in to join the discussion.
Loading…