立即学习:https://edu.csdn.net/course/play/26676/338784?utm_source=blogtoedu
if
elif
...
else
a = 5
if a > 3
a += 1
print(a)
if 'p' in s:
s = 'you need ' + s
print(s)这个也锁进了,但是不影响输出。
import random
import math
n = random.randint(1, 10)
if n > math.pi:
perimeter = n * math.pi
area = math.pi * (n / 2) ** 2
else:
perimenter = 2 * n * math.pi
area = math.pi * pow(n, 2)
POW是啥函数?
a = 'python' if x > 2 else 'physics'