AIR

今天使用python语言制作一个简单的计算体积

1
2
3
4
5
6
7
8
9
10
11
12
13
def get_volume(a):

# print("正方体边长为{}的体积为:".format(a),a*a*a)

​ print("正方体边长为{}的体积为:{}".format(a,a*a*a))


def get_volume2(a,b,c): #长方体的体积 #带多个参数的函数
print("长方体边长分别为{},{},{}的体积为:{}".format(a,b,c,a*b*c))

c = get_volume(10) #c为调用这个函数的结果,但是当前函数并没有任何的结果,所以c为None
print(c)
get_volume2(10,20,30)

简单使用python


 Comments


Blog content follows the Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) License

Use Material X as theme , total visits times .
载入天数...载入时分秒...