立即学习:https://edu.csdn.net/course/play/26676/338784?utm_source=blogtoedu
条件语句:
if(条件为真,则执行其下的代码块):
缩进四个空格 代码块
其余代码
if():
elif():
elif():
else:
import random
random.randint() 随机生成一个整数。
三元操作:
a = 'python' if x>2 else 'physics'
当x>2时 a= python 否则 a= physics