Bootstrap

Python函数 _Code

FunctionStuDemo

# coding=utf-8
def sayHello(): # 定义函数sayHello
print 'Hello world!'
sayHello()  #调用函数sayHello
sayHello()  #可以重复调用
sayHello()
print
def sayHello2(someone):
    print 'Hello',someone
    print someone + ' says Hello!'
sayHello2("Long")
sayHello2('Jason')
print
def plus(num1,num2):
    print 'x=',num1 + num2

plus(2,3)
plus(434434,12313213)
print
def plus(num1,num2):
    print 'x=',num1 * num2

plus(233,322)
plus(434434,12313213)
print

 


 

 

 

;