Returned Function Values
'''A simple function returning a value, used in an expression'''
def f(x,y):
return x*x+y*y
print ("x=3 ,y=4 , x^2+y^2 = ",end='')
print(f(3,4))
print ("x=5 ,y=6 , x^2+y^2 = ",end='')
print(f(5,6))
x=3 ,y=4 , x^2+y^2 = 25
x=5 ,y=6 , x^2+y^2 = 61
>>>
沒有留言:
張貼留言