1、打开cmd
2、进入python交互界面
3、定义多行字符串str = 'ab c \n de f \n gh i\n'
4、用splitlines()进行分割 lines = str.splitlines()
5、打印输出
时间:2024-10-14 16:41:56
1、打开cmd
2、进入python交互界面
3、定义多行字符串str = 'ab c \n de f \n gh i\n'
4、用splitlines()进行分割 lines = str.splitlines()
5、打印输出