关闭

第8个python程序:还是打印

标签: python
102人阅读 评论(0) 收藏 举报
分类:
[root@mysql1 pshell]# cat ex8.py       
#!/usr/bin/env Python
#-*-coding:utf-8-*-


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


print formatter % (1,2,3,4)
print formatter % ("one","two","three","four")
print formatter % (True,False,False,True)
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."
)
[root@mysql1 pshell]# 
[root@mysql1 pshell]# 
[root@mysql1 pshell]# 
[root@mysql1 pshell]# 
[root@mysql1 pshell]# python ex8.py 
1 2 3 4
'one' 'two' 'three' 'four'
True False False True
'%r %r %r %r' '%r %r %r %r' '%r %r %r %r' '%r %r %r %r'
'i had this thing.' 'that you could type up right.' "but it didn't sing." 'so i said goodnight.'
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:129874次
    • 积分:2802
    • 等级:
    • 排名:第12817名
    • 原创:167篇
    • 转载:3篇
    • 译文:0篇
    • 评论:3条
    文章分类
    最新评论