Python基础
关键字
from keyword import kwlist
print(kwlist)
输出 
统计个数
print(len(kwlist))
输出 36
if判断
# if判断
a = 1
b = 2
# a,b = 1,2
if a > b:
print("a大于b")
else:
print("a小于b")
输出a小于b
真假判断
# 真假判断
if True:
print("true")
else:
print("false")
\用法
one,two,three = 1,2,3
total = one + \
two + \
three
print(total)
print输出换行
print("换行1")
print("换行2")
print("不换行1" , end='')
print("不换行2" , end='')
# print输出换行 sep作用:指定间隔
print("不换行2" , "不换行2")
print("不换行2" , "不换行2",sep='@')
输出结果:  
for循环
import sys
print('命令参数为')
for i in sys.argv:
print(i)

判断最大值
# 判断最大值
max = max(1,2,3)
print(max)
输出:3
|