摘要:        
python提供%对各类型的数据进行格式化输出。 >>> price = 108 >>> print("the book's price is %s" % price) the book's price is 108 print函数包含三部分,第一部分格式化字符串(它相当于字符串模板),该格式化字符    阅读全文
posted @ 2021-03-26 14:03
星火撩原
阅读(717)
评论(0)
推荐(0)
        
            
        
        
摘要:        
在字符串可以使用反斜线进行转义,如果字符串本身包含反斜线,需要使用\\表示,\\就是转义字符。Python当然不会只支持几个转义字符。 >>> s = 'hello\ncharlie\ngood\nmorning' >>> print(s) hello charlie good morning >>    阅读全文
posted @ 2021-03-26 12:17
星火撩原
阅读(46)
评论(0)
推荐(0)
        

 浙公网安备 33010602011771号
浙公网安备 33010602011771号