摘要:
1.列表的使用 shoplist = ['apple','mango' ,'carrot','banana']print ('I have ',len(shoplist),'items to purchase') print ('These items are:',)for item in shop 阅读全文
摘要:
1.新建自己的模块 def sayhi(): print ('Hi, this is mymodule speaking.') Version = '0.1' 调用自己的模块 import mymodule mymodule.sayhi()print ('Version ', mymodule.Ve 阅读全文
摘要:
1.全局变量写法 def func(): global x print ('x is',x) x=2 print ('Changed local x to', x)x= 50func()print ('x is still' ,x ) 2.改变形参和不改变形参设默认值用法 def say(messa 阅读全文