我有一段文字像这样交给我:
here is line one\n\nhere is line two\n\nhere is line three
我想做的是将这个字符串分成三个独立的变量。 我不太确定如何在 python 中完成此任务。
感谢您的帮助, jml
请您参考如下方法:
a, b, c = s.split('\n\n')
我有一段文字像这样交给我:
here is line one\n\nhere is line two\n\nhere is line three
我想做的是将这个字符串分成三个独立的变量。 我不太确定如何在 python 中完成此任务。
感谢您的帮助, jml
请您参考如下方法:
a, b, c = s.split('\n\n')