1. 输入输出:
输出
print('hello world')
hello world
print('a','d')
//遇到逗号会输出空格,输出 a d
>>> print(300)
300
>>> print(100 + 200)
300
>>> print('100 + 200 =', 100 + 200)
100 + 200 = 300
输入
name = input()
//输入之后,name即为输入的内容
name = input('please input your name: ')
print("hello ",name)
2. 退出编辑器:
exit()
3. 编辑器保存python文件:后缀py 选择UTF-8 无BOM 格式
4. 代码缩进 : 冒号就是代码块开始的地方
# print absolute value of an integer:
a = 100
if a >= 0:
print(a)
else:
print(-a)
5. 注释 #