Python: '#' Comments after backslash
问题 This doesn't work: something = \ line_of_code * \ # Comment another_line_of_code * \ # Comment and_another_one * \ # Comment etc Neither does this: something = \ # Comment \ line_of_code * \ # Comment \ another_line_of_code * ... Neither does this: something = \ ''' Comment ''' \ line_of_code * \ ''' Comment ''' \ another_line_of_code * ... If there a way to make comments in the code broken into multiple lines? 回答1: Do it like that: a, b, c, d = range(1, 5) result = ( # First is 1 a * # Then