python多行字符拼接使用小括号
* 多行字符串拼接使用小括号
1 2 3 4 5 6 7 | s = ( 'select *' 'from atable' 'where id=888' ) print s, type (s) #输出 select * from atablewhere id = 888 < type 'str' > |
* python遇到未闭合的小括号,自动将多行拼接为一行,相比三个引号和换行符,这种方式不会把换行符、前导空格当作字符。
2020年12月23日 17:33
Exactly what I was searching for, thank you for posting. where to buy medical masks