欢迎光临
一直在努力

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

练习:
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.在一行的起始位置放一个 ‘#’ 符号的作用是什么?
表示注释,‘#’之后这行代码不会执行。

赞(1)
未经允许不得转载:在路上 » 笨办法学python-习题1:第一个程序

评论 抢沙发

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