您的位置:首页 > 编程语言 > Python开发

笨办法学python习题7 更多打印

2017-11-05 19:24 225 查看
这个习题比较简单,设计到字符串的相加和相乘!话不多说,直接上代码:

print("Mary had a little lamb")
print("Its fleece was white as %s." %'snow')
print("And everwhere that Mary went.")
print("."*10)

end1 = "C"
end2 = "h"
end3 = "e"*2
end4 = "s"
end5 = "e"
print(end1+end2+end3+end4+end5)

运行结果:
mystuff simengred$ python ex7.py
Mary had a little lamb
Its fleece was white as snow.
And everwhere that Mary went.
..........
Cheese
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  字符串