【Python】方法的返回值

今日学习:Exercise 21: Functions Can Return Something

1.【IndentationError: unexpected indent】 这个表示有缩进的错误。

2.【def xxxx(x,x,x):】冒号不要忘

3.定义函数时,return的要为你要计算的公式

def math(a,b,c,d):
print "Math is %d*%d-%d+%d" %(a,b,c,d)
return a*b-c+d

感谢阅读,一起努力呗!
原文地址:https://www.cnblogs.com/jennyhui/p/2815343.html