Python学习笔记(笨方法学Python3)-习题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.')

将这段代码保存为ex1.py

运行:
在终端(Powershell)直接 python ex1.py

常见错误:
运行时看到“syntaxerror:invalid syntax”
原因:在终端上运行一遍Python后,又运行了一遍Python,重启终端即可。

猜你喜欢

转载自blog.csdn.net/qq_34595352/article/details/89022299
今日推荐