使用 print(’’)
Type the following text into a single file named ex1.py 。 输入以下文本到文件 ex1.py
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.') # 单引号里带双引号
What you should see
Hello World!
Hello Again
I like typing this.
This is fun.
Yay! Printing.
I'd much rather you 'not'.
I "said" do not touch this.
Study Drills 扩展练习
- 再打一行
- 用一行完成你的脚本
- 在行首插入 # 符号,看看啥意思
# 再打一行
print('大叔学python')
# 一行脚本
print("Hello World!","Hello Again","I like typing this.","This is fun.",'Yay! Printing.',"I'd much rather you 'not'.",'I "said" do not touch this.')
# print("带#号表示注释,脚本不运行")
运行:
大叔学python
Hello World! Hello Again I like typing this. This is fun. Yay! Printing. I'd much rather you 'not'. I "said" do not touch this.