标签:
def fun(x,y): print x,y name=raw_input(‘name:‘) fun(name,‘100000‘)
指定默认值:
def fun(x=‘20‘,y=‘奶油‘): #从右向左 print ‘制作一个%s元,%s口味的冰激凌‘%(x,y) fun(‘100000‘) def fun(x=‘20‘,y): #从右向左,这样是错的
返回值
几个函数的互相调用
def promot(): name=raw_input(‘name:‘) salary=raw_input(‘salary:‘) login(name) return name,salary def login(name): if name==‘lanny‘: print ‘welcome‘,name,‘to login‘ def info(): name,salary=promot() print ‘‘‘ ***********personal info************ name:%s salary:%s ‘‘‘%(name,salary) if __name__==‘__main__‘: info()
标签:
原文地址:http://www.cnblogs.com/iiiiher/p/5881132.html