PythonµÄ×Ö·û´®
PythonÖÐ×Ö·û´®±»¶¨ÒåΪÒýºÅÖ®¼äµÄ×Ö·û¼¯ºÏ¡£PythonÖ§³ÖʹÓóɶԵĵ¥ÒýºÅ»òË«ÒýºÅ£¬ÈýÒýºÅ°üº¬µÄ×Ö·û´®¡£
ʹÓÃË÷Òý²Ù×÷·û([])ºÍÇÐƬ²Ù×÷·û([:])¿ÉÒԵõ½×Ó×Ö·û´®¡£×Ö·û´®ÓÐÆäÌØÓеÄË÷Òý¹æÔò£ºµÚÒ»¸ö×Ö·ûµÄË÷ÒýÊÇ£°
£¬×îºóÒ»¸ö×Ö·ûµÄË÷ÒýÊÇ-1¡£
¼ÓºÅ(+)ÓÃÓÚ×Ö·û´®Á¬½ÓÔËË㣬ÐǺÅ(*)ÔòÓÃÓÚ×Ö·û´®Öظ´¡£ÈçÏÂÀý£º
pystr = "Python"
pystr[2:5]½á¹ûΪ£ºtho
'''
Created on 2010-1-12
@author: cuser
'''
s = "abcd"
'''
print(s[0])
print(s[1])
print(s[2])
print(s[3])
print(s[-1])#×îºóÒ»¸ö×Ö·ûµÄË÷ÒýΪ-1
'''
print(s[0:1])
print(s[0:2])
print(s[2:3])
print(s[:2])
print(s[2:])
print(s*2)
print(s*3)
½á¹ûÈçÏ£º
a
ab
c
ab
cd
abcdabcd
abcdabcdabcd
Ïà¹ØÎĵµ£º
1.³£Ó÷½·¨£¬²»´ø²ÎÊý
def decator(func):
def inner_func(*args):
args = (i * 2 for i in args)
return func(*args)
return inner_func
@decator
def add(a, ......
лÁËÒ»¸ö×Ô¶¯ÏÂÔØÖ¸¶¨È˵IJ©¿ÍµÄ½Å±¾
Õâ¸ö½Å±¾ÊÇÓÃÀ´ÏÂÔØcsdn²©¿ÍµÄ
ͬÑùµÄ·½·¨¿ÉÒÔÏÂÔØÒ»°ãÆäËûÍøÕ¾µÄ²©¿Í£¬Èçsina
ÓÐʱҳÃæ·ÃÎʻᱻ¾Ü¾ø£¬ÖØÐÂÔËÐм´¿É
ÕâÖÖ³ÌÐòÊÇÔÚ·ÖÎöÁËÖ¸¶¨ÍøÕ¾£¬ÎÒÔÚÕâ¶ùÊÇcsdn£¬Ö®ºó±àд³öµÄ
»áÇ£Éæµ½ÍøÒ³µÄ±àÂëÎÊÌ⣬ÓÐʱ³ÌÐòÔËÐлáÒò´ËÖÕÖ¹
ÎÒ×Ô¼ºµÄ²©¿ÍÒѾÏÂÔØÍüÁË
Ö»ÊÇÏÂÔØÍøÒ³
ʹÓÃÍø ......
1.½âÊÍÐÔ ¿ÉÒÔÖ±½Ó´ÓÔ´´úÂëÔËÐгÌÐò.ÔÚ¼ÆËã»úÄÚ²¿,Python½âÊÍÆ÷°ÑÔ´´úÂëת»»³É³ÆΪ×Ö½ÚÂëµÄÖмäÐÎʽ,È»ºóÔÙ°ÑËü·Òë³É¼ÆËã»úʹÓõĻúÆ÷ÓïÑÔ²¢ÔËÐÐ.
2.#·ûºÅºóÃæµÄÄÚÈݶ¼ÊÇ×¢ÊÍ.
3.ÔÚ×Ö·û´®ÖÐÐÐÄ©µÄ'\'±íʾÏÂÒ»ÐеÄÄÚÈݺÍÉÏÒ»ÐÐÊǽÓ×ŵÄ;×Ö·û´®Ç°¼ÓÒ»¸ör±íʾijЩ²»ÐèҪתÒå·ûÄÇÑùµÄÌرð´¦ÀíµÄ×Ö·û´®;ÔÚ´¦ÀíÎı¾ÎļþµÄʱºòÊ ......
http://code.google.com/p/shedskin/ Shed Skin 0.3 - support for 3 new standard library modules (now about 20 in total): - itertools (jeremie roquet) - heapq (jeremie roquet) - csv (converted using shedskin) - 4 new example programs (now 44 in total!): - maximum weighted matching al ......
1.#£º×¢ÊÍ·û
2.±È½ÏÔËËã·û(»ù±¾ºÍJavaÀàËÆ)
< <= > >= == != <>
PythonÄ¿Ç°Ö§³ÖÁ½ÖÖ"²»µÈÓÚ"±È½ÏÔËËã·û£¬!=ºÍ<>£¬·Ö±ðÊÇC·ç¸ñºÍABC/Pascal·ç¸ñ¡£Ä¿Ç°ºóÕßÂýÂýµØ±»ÌÔÌÁË£¬
ÍƼöʹÓÃÇ°Õß¡£
ÔÚPythonÖУ¬Ö§³Ö3<4<5ÕâÑùµÄ±í´ïʽ£¬¼ ......