#coding=utf-8
def plus(a, b):
return a + b
def jian(a, b):
return a - b
def cheng(a, b):
return a * b
def chu(a, b):
return a / b
x = plus(50, 10)
y = jian(50, 10)
z = cheng(50, 10)
z2 = chu(50, 20)
return a + b
def jian(a, b):
return a - b
def cheng(a, b):
return a * b
def chu(a, b):
return a / b
x = plus(50, 10)
y = jian(50, 10)
z = cheng(50, 10)
z2 = chu(50, 20)
print " There're %d people who didn\'t pay, %d people who already paid, %d people promise will pay, %d peole will not pay." % (x, y, z, z2)
#可以这样理解,假设我们把return全部换成print,这个代码是不会运作的,因为print不会返回 两个参数之间的结果。
def worker(a, b, c):
x = a + b
y = x * c
return y
result = worker(1, 2, 3)
x = a + b
y = x * c
return y
result = worker(1, 2, 3)
print"result %d" % result