'''
Created on 2016年12月16日
@author: Administrator
'''
'''定义函数 '''
def sey_hi():
print("hi~");
sey_hi()
"""传参数函数"""
def sey_a_b(a,b):
return a+b
print(sey_a_b(2, 4))
def say_hell_hi(str):
print("hello "+str+"!")
say_hell_hi("jack")
def repest_str(str,tiems):
repeated_str=str * tiems
return repeated_str
repest_strings=repest_str("hello ", 4)
print(repest_strings)
print("hello "*4)
def foo():
global x
print(str(x))
print(x)
def fooo(s,t=1):
repeated=s*t;
return repeated
print(fooo("jack",))
def func(a,b=10,c=8):
print("a is ",a ,"b is ",b,"c is ",c)
func(123,c=23)
def print_paras(fpara,*nums,**words):
print("fpara "+str(fpara))
print("nums"+str(nums))
print("words"+str(words))
print_paras("hello",1,3,5,7,words="python",anohter_words="java")