Allen-win

Python中一般是一行写完所有代码,如果遇到一行写不完需要换行的情况,有两种方法:

1.在该行代码末尾加上续行符“ \”(即空格+\);

test = \'item_one\' \

\'item_two\' \

  \'tem_three\'

输出结果:\'item_oneitem_twotem_three\'

2.加上括号,() {}  []中不需要特别加换行符:

test2 = (\'csdn \'

\'cssdn\')

输出结果:csdn cssdn

if...and:

if (where there is a will and

there is a way)

多次未输出结果

test3 =(\'Hello\'

\' \'

\'world\')

输出结果:Hello world

 

From:https://blog.csdn.net/baihhzm/article/details/73433160

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2023-03-21
  • 2021-12-29
  • 2022-02-18
猜你喜欢
  • 2022-02-04
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2021-04-20
相关资源
相似解决方案