编程知识 cdmana.com

Can you explain this procedure

img




Refer to the answer 1:

First of all, it defines a name calu Function of , The function is to calculate x Of y To the power of z. This function can accept three parameters , The default value is x=3,y=2,z=10. Call back calu(h,w) Two values were passed , It covers the first two x,y Value , Now is x=h,y=w,z=10; After the calculation is 2 To the third power of 10 In the end, it's equal to 80




Refer to the answer 2:



Refer to the answer 3:
def calu (x=1,y=2,z=10):  ###  Defined function , Pass in three parameters     return x**y*z                 ### x Of y Power times z And back to h=2w=3print(calu(h,w))  ###  Call function calu, And pass in 2 Parameters . When the parameter here is less than three , Then replace only the first two . therefore x=h=2,y=w=3,z=10

So the result is 2 Of 3 To the power of 10 by 80




Refer to the answer 4:

版权声明
本文为[CSDN Q & A]所创,转载请带上原文链接,感谢
https://cdmana.com/2021/11/20211108194931448o.html

Scroll to Top