锘??xml version="1.0" encoding="utf-8" standalone="yes"?>伊人春色之综合网,97视频精彩视频在线观看,国产黄色片在线播放http://www.aygfsteel.com/jicheng687/category/48853.htmlSET, Python, Java, DB, Archzh-cnSat, 13 Aug 2011 11:15:42 GMTSat, 13 Aug 2011 11:15:42 GMT60銆愯漿銆慞ython鐨勬爣鍑唋ogging妯″潡http://www.aygfsteel.com/jicheng687/archive/2011/08/12/356373.html姝ユ涓鴻惀姝ユ涓鴻惀Fri, 12 Aug 2011 06:49:00 GMThttp://www.aygfsteel.com/jicheng687/archive/2011/08/12/356373.htmlhttp://www.aygfsteel.com/jicheng687/comments/356373.htmlhttp://www.aygfsteel.com/jicheng687/archive/2011/08/12/356373.html#Feedback0http://www.aygfsteel.com/jicheng687/comments/commentRss/356373.htmlhttp://www.aygfsteel.com/jicheng687/services/trackbacks/356373.html
  闃呰鍏ㄦ枃

姝ユ涓鴻惀 2011-08-12 14:49 鍙戣〃璇勮
]]>
Special Methods for Customizing Classeshttp://www.aygfsteel.com/jicheng687/archive/2011/07/21/354826.html姝ユ涓鴻惀姝ユ涓鴻惀Thu, 21 Jul 2011 15:25:00 GMThttp://www.aygfsteel.com/jicheng687/archive/2011/07/21/354826.htmlhttp://www.aygfsteel.com/jicheng687/comments/354826.htmlhttp://www.aygfsteel.com/jicheng687/archive/2011/07/21/354826.html#Feedback0http://www.aygfsteel.com/jicheng687/comments/commentRss/354826.htmlhttp://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

  闃呰鍏ㄦ枃

姝ユ涓鴻惀 2011-07-21 23:25 鍙戣〃璇勮
]]>
瀛︿範Python鐨勫ソ緗戠珯http://www.aygfsteel.com/jicheng687/archive/2011/06/17/352541.html姝ユ涓鴻惀姝ユ涓鴻惀Fri, 17 Jun 2011 12:26:00 GMThttp://www.aygfsteel.com/jicheng687/archive/2011/06/17/352541.htmlhttp://www.aygfsteel.com/jicheng687/comments/352541.htmlhttp://www.aygfsteel.com/jicheng687/archive/2011/06/17/352541.html#Feedback2http://www.aygfsteel.com/jicheng687/comments/commentRss/352541.htmlhttp://www.aygfsteel.com/jicheng687/services/trackbacks/352541.html1)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(11000if i % 3 == 0 or i % 5 == 0)

 


 



姝ユ涓鴻惀 2011-06-17 20:26 鍙戣〃璇勮
]]>
Python涓殑Closurehttp://www.aygfsteel.com/jicheng687/archive/2011/06/15/352324.html姝ユ涓鴻惀姝ユ涓鴻惀Tue, 14 Jun 2011 23:31:00 GMThttp://www.aygfsteel.com/jicheng687/archive/2011/06/15/352324.htmlhttp://www.aygfsteel.com/jicheng687/comments/352324.htmlhttp://www.aygfsteel.com/jicheng687/archive/2011/06/15/352324.html#Feedback0http://www.aygfsteel.com/jicheng687/comments/commentRss/352324.htmlhttp://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爜紺轟緥

 1def 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
 9if __name__ == '__main__':
10    c = counter(3)
11    print type(c)
12    print c()
13    print c()
14


 



姝ユ涓鴻惀 2011-06-15 07:31 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 安国市| 隆化县| 深圳市| 房产| 江达县| 友谊县| 重庆市| 崇州市| 丰原市| 海门市| 上犹县| 崇左市| 同德县| 镇坪县| 大城县| 新绛县| 勃利县| 太原市| 三江| 宝兴县| 深圳市| 巴彦县| 卢龙县| 大姚县| 宁都县| 和田县| 云霄县| 宣化县| 桂林市| 晋中市| 涟源市| 南开区| 屏南县| 东兰县| 叶城县| 石嘴山市| 九江市| 临邑县| 麻江县| 阳西县| 都安|