锘??xml version="1.0" encoding="utf-8" standalone="yes"?>精品免费二区三区三区高中清不卡,亚洲三级精品,日本亚洲欧美天堂免费 http://www.aygfsteel.com/jicheng687/category/48853.htmlSET, Python, Java, DB, Arch zh-cn Sat, 13 Aug 2011 11:15:42 GMT Sat, 13 Aug 2011 11:15:42 GMT 60 銆愯漿銆慞ython鐨勬爣鍑唋ogging妯″潡 http://www.aygfsteel.com/jicheng687/archive/2011/08/12/356373.html姝ユ涓鴻惀 姝ユ涓鴻惀 Fri, 12 Aug 2011 06:49:00 GMT http://www.aygfsteel.com/jicheng687/archive/2011/08/12/356373.html http://www.aygfsteel.com/jicheng687/comments/356373.html http://www.aygfsteel.com/jicheng687/archive/2011/08/12/356373.html#Feedback 0 http://www.aygfsteel.com/jicheng687/comments/commentRss/356373.html http://www.aygfsteel.com/jicheng687/services/trackbacks/356373.html
闃呰鍏ㄦ枃 ]]> Special Methods for Customizing Classes http://www.aygfsteel.com/jicheng687/archive/2011/07/21/354826.html姝ユ涓鴻惀 姝ユ涓鴻惀 Thu, 21 Jul 2011 15:25:00 GMT http://www.aygfsteel.com/jicheng687/archive/2011/07/21/354826.html http://www.aygfsteel.com/jicheng687/comments/354826.html http://www.aygfsteel.com/jicheng687/archive/2011/07/21/354826.html#Feedback 0 http://www.aygfsteel.com/jicheng687/comments/commentRss/354826.html http://www.aygfsteel.com/jicheng687/services/trackbacks/354826.html Constructor (with any optional arguments)
C.__new__(self[, arg1, ...] )[a]
Constructor (with any optional argu ments); usually used for setting up subclassing of immutable data types
C.__del__(self)
Destructor
C.__str__(self)
Printable string representation; str() built-in and print statement
C.__repr__(self)
Evaluatable string representation; repr() built-in and '' operator
闃呰鍏ㄦ枃 ]]> 瀛︿範Python鐨勫ソ緗戠珯 http://www.aygfsteel.com/jicheng687/archive/2011/06/17/352541.html姝ユ涓鴻惀 姝ユ涓鴻惀 Fri, 17 Jun 2011 12:26:00 GMT http://www.aygfsteel.com/jicheng687/archive/2011/06/17/352541.html http://www.aygfsteel.com/jicheng687/comments/352541.html http://www.aygfsteel.com/jicheng687/archive/2011/06/17/352541.html#Feedback 2 http://www.aygfsteel.com/jicheng687/comments/commentRss/352541.html http://www.aygfsteel.com/jicheng687/services/trackbacks/352541.html 1)http://www.pythonchallenge.com/ 鎻愪緵浜嗕笉鍚宭evel鐨凱ython棰樼洰錛岄潪甯告湁瓚g殑棰樼洰銆傚仛瀹屼竴棰樺悗錛屾妸URL涓殑pc鏀逛負pcc鍙互鐪嬪埌涓婁竴棰樼殑絳旀 2)http://projecteuler.net/ 閲岄潰鏈?00澶氶亾棰樼洰錛屼笉瑕佽姹傛彁浜や唬鐮侊紝鍙鏈緇堢瓟妗堬紝鎻愪緵鐢ㄥ悇縐嶈璦鏉ヨВ鍐抽棶棰樸傝繖閲岋紙http://dcy.is-programmer.com/posts/8750.html 錛夋湁閮ㄥ垎棰樼洰鐨勭瓟妗?br /> 闈炲父濂界帺錛屾湁鍏磋叮鐨勬湅鍙嬶紝蹇潵璇曡瘯鍚?br />
鐪嬬湅 project euler 鐨勭涓閬撻錛?/p>
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
鐢?python 璇█鍐欏嚭鏉ユ槸錛?/p>
print sum(i for i in xrange( 1 , 1000 ) if i % 3 == 0 or i % 5 == 0)
]]> Python涓殑Closure http://www.aygfsteel.com/jicheng687/archive/2011/06/15/352324.html姝ユ涓鴻惀 姝ユ涓鴻惀 Tue, 14 Jun 2011 23:31:00 GMT http://www.aygfsteel.com/jicheng687/archive/2011/06/15/352324.html http://www.aygfsteel.com/jicheng687/comments/352324.html http://www.aygfsteel.com/jicheng687/archive/2011/06/15/352324.html#Feedback 0 http://www.aygfsteel.com/jicheng687/comments/commentRss/352324.html http://www.aygfsteel.com/jicheng687/services/trackbacks/352324.html #瀹氫箟錛氬鏋滃湪涓涓唴閮ㄥ嚱鏁伴噷錛屽鍦ㄥ閮ㄤ綔鐢ㄥ煙錛堜絾涓嶆槸鍦ㄥ叏灞浣滅敤鍩燂級鐨勫彉閲忚繘琛屽紩鐢紝閭d箞鍐呴儴鍑芥暟灝辮璁や負鏄棴鍖咃紙closure錛?br />鍒嗚В鏉ヨ錛屽寘鍚笅闈?涓潯浠訛細 1) 闇瑕佸嚱鏁板祵濂? 灝辨槸涓涓嚱鏁伴噷闈㈠啀鍐欎竴涓嚱鏁? 2) 澶栭儴鍑芥暟闇瑕佽繑鍥炰竴涓唴閮ㄥ嚱鏁扮殑寮?br />3) 澶栭儴鍑芥暟涓湁涓浜涘眬閮ㄥ彉閲? 騫朵笖, 榪欎簺灞閮ㄥ彉閲忓湪鍐呴儴鍑芥暟涓湁浣跨敤 涓浜涙蹇? 1)鑷敱鍙橀噺: 澶栭儴鍑芥暟涓畾涔夌殑灞閮ㄥ彉閲? 騫朵笖鍦ㄥ唴閮ㄥ嚱鏁頒腑琚嬌鐢?br />2) 闂寘: 閭d釜浣跨敤浜嗚嚜鐢卞彉閲忓茍琚繑鍥炵殑鍐呴儴鍑芥暟灝辯О涓洪棴鍖?br />
#鏀寔闂寘鐨勮璦鏈夎繖鏍風殑鐗規э細 1)鍑芥暟鏄竴闃跺鹼紙First-class value錛夛紝鍗沖嚱鏁板彲浠ヤ綔涓哄彟涓涓嚱鏁扮殑榪斿洖鍊兼垨鍙傛暟錛岃繕鍙互浣滀負涓涓彉閲忕殑鍊?br />2)鍑芥暟鍙互宓屽瀹氫箟錛屽嵆鍦ㄤ竴涓嚱鏁板唴閮ㄥ彲浠ュ畾涔夊彟涓涓嚱鏁?br /> #浠g爜紺轟緥
1 def counter(start_at = 0): 2 count = [start_at] 3 def incr(): 4 count[0] += 1 # 瀵瑰眬閮ㄥ彉閲忕殑寮曠敤 5 return count[0] 6 return incr # 榪斿洖涓涓嚱鏁板璞?/span> 7 8 9 if __name__ == ' __main__ ' : 10 c = counter( 3 ) 11 print type(c) 12 print c() 13 print c() 14
]]>
主站蜘蛛池模板:
沾益县 |
乌鲁木齐县 |
诸城市 |
灵川县 |
都兰县 |
高青县 |
琼中 |
上思县 |
白沙 |
辽中县 |
古丈县 |
汉沽区 |
新郑市 |
新和县 |
永年县 |
天等县 |
武冈市 |
拉萨市 |
舟曲县 |
柏乡县 |
黄大仙区 |
普定县 |
富平县 |
崇信县 |
麻栗坡县 |
文登市 |
明光市 |
武安市 |
潮州市 |
竹山县 |
囊谦县 |
涡阳县 |
兴业县 |
新巴尔虎右旗 |
龙江县 |
沈丘县 |
伊宁县 |
江西省 |
福贡县 |
库车县 |
台北县 |