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

来源:互联网 发布:hp1022n网络打印驱动 编辑:程序博客网 时间:2024/05/22 12:47

这个习题比较简单,设计到字符串的相加和相乘!话不多说,直接上代码:

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"*2end4 = "s"end5 = "e"print(end1+end2+end3+end4+end5)

运行结果:

mystuff simengred$ python ex7.pyMary had a little lambIts fleece was white as snow.And everwhere that Mary went...........Cheese


原创粉丝点击