• 欢迎访问我的个人博客网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站。
  • 如果您觉得本站对您有用,那么赶紧使用Ctrl+D收藏吧!
  • 相关内容持续完善中......

笨办法学python-习题1:第一个程序

Python hubin 1年前 (2018-02-05) 668次浏览 0个评论 扫描二维码

练习:
print “Hello World!”
print “Hello Again”
print “I like typing this.”
print “This is fun.”
print ‘Yay! Printing.’
print “I’d much rather you ‘not’.”
print ‘I “said” do not touch this.’

习题:
1.让你的脚本再多打印一行
#–coding:utf-8–
print “Hello World!”
print “Hello Again”
print “I like typing this.”
print “This is fun.”
print ‘Yay! Printing.’
print “I’d much rather you ‘not’.”
print ‘I “said” do not touch this.’
print u’多打印一行’
2.让你的脚本只打印一行
#–coding:utf-8–
print “Hello World!”,
print “Hello Again”,
print “I like typing this.”,
print “This is fun.”,
print ‘Yay! Printing.’,
print “I’d much rather you ‘not’.”,
print ‘I “said” do not touch this.’,
print u’多打印一行’
PS:python3
print(“Hello World!”, end=”)
print(“Hello Again”, end=”)
print(“I like typing this.”, end=”)
print(“This is fun.”, end=”)
print(‘Yay! Printing.’, end=”)
print(“I’d much rather you ‘not’.”, end=”)
print(‘I “said” do not touch this.’)
3.在一行的起始位置放一个 ‘#’ 符号的作用是什么?
表示注释,‘#’之后这行代码不会执行。


本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:笨办法学python-习题1:第一个程序
喜欢 (0)
hubin
关于作者:
头像
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址