社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  问与答

新手小白请教:为什么这样写会打印出单引号呢?关键字:print+字符串

ggmmqeqffa • 5 年前 • 496 次点击  

请教一下,代码如下:

formatter = "%r %r %r %r"

print formatter%(formatter,formatter,formatter,formatter)

print formatter % ( "I had this thing.", "That you could type up right.", "But it didn't sing.", "So I said goodnight." )

为什么打印出来会有单引号????

最后一次修改于 (2019-02-21 20:52)
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/29034
 
496 次点击  
文章 [ 1 ]  |  最新文章 5 年前
ggmmqeqffa
Reply   •   1 楼
ggmmqeqffa    5 年前

不理解 难道字符串里的字符串,编译器会自动加单引号吗?