数据驱动方式尝试
This commit is contained in:
11
05-Other/variable/my2.py
Normal file
11
05-Other/variable/my2.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import math
|
||||
|
||||
_all_ = ['AREA1','AREA2']
|
||||
def get_area(diameter):
|
||||
radius = diameter/2
|
||||
area = math.pi*radius*radius
|
||||
return area
|
||||
|
||||
AREA1 = get_area(1)
|
||||
AREA2 = get_area(2)
|
||||
|
||||
Reference in New Issue
Block a user