1 Star 0 Fork 0

lhjlzf / Learn Python The Hard Way Note

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ex8.py 516 Bytes
一键复制 编辑 原始数据 按行查看 历史
# _*_ 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))
# %r 打印字符时,字符串的引号默认打印单引号
# 如果字符串中包含单引号,则打印为双引号
print (formatter % (
"I had this thing.",
"That you could type up right.",
"But it didn't sing.",
"So I said goodnight."
))
Python
1
https://gitee.com/lhjzf/Learn-Python-The-Hard-Way-Note.git
git@gitee.com:lhjzf/Learn-Python-The-Hard-Way-Note.git
lhjzf
Learn-Python-The-Hard-Way-Note
Learn Python The Hard Way Note
master

搜索帮助