欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

笨方法学python笔记:习题7 更多打印

程序员文章站 2022-06-16 09:24:10
...

这本书好像还是比较墨迹一点哈哈
例程:

print("Marry had a little lamb.")
print("It's fleece was white as %s."%'snow')
print("And everything that Mary went.")
print("."*10)#这在干嘛?重复打印:字符串*数字

end1="C"
end2="h"
end3="e"
end4="e"
end5="s"
end6="e"
end7="B"
end8="u"
end9="r"
end10="g"
end11="e"
end12="r"

#python打印默认换行,加上end=' '改为空格间隔
print(end1+end2+end3+end4+end5+end6, end=' ')
print(end7+end8+end9+end10+end11+end12)

打印结果:

Marry had a little lamb.
It's fleece was white as snow.
And everything that Mary went.
..........
Cheese Burger