首页 > 编程语言 >【笨方法学python】ex7 - 更多打印

【笨方法学python】ex7 - 更多打印

时间:2022-10-05 03:55:49浏览次数:49  
标签:end1 end3 end2 end5 python 打印 ex7 print 方法学

代码如下:

点击查看代码
# -*-coding:utf-8- -*-
# 更多打印

print "Mary had a little lamb."
print "Its fleefe was white as %s." % 'snow'
print "And everywhere that Mary went."
print "." * 10 # what'd that do

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

# watch that comma at the end. try removing it to see what happens #注意末尾的逗号。试着把它移走看看会发生什么
print end1 + end2 + end3 + end4 + end5 + end6, # 逗号表示连接下一行
print end7 + end8 + end9 + end10 + end11 + end12

执行结果:
image

标签:end1,end3,end2,end5,python,打印,ex7,print,方法学
From: https://www.cnblogs.com/TiramisuPS/p/16754964.html

相关文章

  • 【笨方法学python】ex8 - 打印,打印
    代码如下:点击查看代码#-*-coding:utf-8--*-#打印,打印formatter="%r%r%r%r"printformatter%(1,2,3,4)printformatter%('one','two','three','......
  • 【笨方法学python】ex9 - 打印,打印,打印
    代码如下:点击查看代码#-*-coding:utf-8--*-#打印,打印,打印#Here'ssomenewstrangestuff,remembertypeitexactly.days="MonTueWedThuFriSatSun"......
  • 【笨方法学python】ex2 - 注释符
    代码如下:点击查看代码#-*-coding:utf-8-*-#Acomment,thisissoyoucanreadyourprogramlater.#Anythingafterthe#isignoredbypython.#一个注释......
  • 【笨方法学python】print
    代码如下#-*-coding:utf-8--*-print"HelloWorld"print"HelloAgain"print"Iliketypingthis."print"Thisisfun."print"Yay!Printing."print"I'dmuch......
  • Python 注册菜单
    我们看到下面的示例图是在右键文件夹上查看菜单,带有两级的菜单选项。需要使用管理员权限运行因为右键菜单需要注册表信息,打开注册表需要管理员权限UAC,所以在执行命令过......
  • python安装及环境变量配置
    python环境变量配置1、双击安装包,出现如下的安装界面,选择自定义安装2、选项设置,默认全部勾选即可3、高级配置选线,如图勾选即可4、如下图所示,安装过程中5、......
  • python 输出
    1.print()函数1.1print()输出格式①print()可以输出多个内容print(内容1,内容2,...,内容3)②print(f"内容1{},内容2{}...")③print(""%())1.2print输出换行与不......
  • XX学Python·前端
    HTML:网页结构布局HTML(HyperTextMark-upLanguage)超文本标记语言。HTML控制页面整体布局书写形式用标签形式, <标签名称> </标签名称>,比如: <html></html......
  • XX学Python·高级语法
    闭包和装饰器当返回的内部函数使用了外部函数的变量就形成了闭包,闭包可对外部函数变量进行保存#使用闭包的格式defout_func():print('外部函数调用')a=......
  • XX学Python·mini web开发案例
    mini_web开发案例参考阶段三day07面对对象动态服务器importsocketimportthreadingimportjsonclassWebServer():def__init__(self):#一、创......