Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

python Êý×飬ÐòÁУ¬×ֵ䣬ÁÐ±í£¬Ðò±í£¬Ôª×棨tuple£©

python ûÓÐÊý×éµÄÊý¾Ý½á¹¹
#list ÐòÁÐ
sample_list = [1,2,3,'abc']
#dictionary ×Öµä
sample_dic = {"key":value, 2:3}
#tuple Ö»¶ÁµÄÐòÁÐ
sample_tuple = (1,3,"ab")
Ðò±í
    Ðò±íÓÉһϵÁÐÖµÓöººÅ·Ö¸ô¶ø³É
    Ðò±íÓë×Ö·û´®Ò»ÑùÊDz»¿É±äµÄ£º²»ÔÊÐí¶ÔÐò±íµÄijһÏֵ
×Öµä
    ¹ØÁªÊý×é
Óë×Ö·û´®²»Í¬µÄÊÇÁбíÊǿɱäµÄ£¬¿ÉÒÔÐÞ¸ÄÁбíµÄÿ¸öÔªËØ
¿ÉÒÔ½¨Á¢Ç¶Ì×ÁÐ±í£¨±íµÄÔªËØÒ²ÊÇÁÐ±í£©
ÁÐ±í·½·¨
    ÁбíÊý¾ÝÀàÐÍ»¹ÓÐÆäËüһЩ·½·¨¡£ÏÂÃæÊÇÁбí¶ÔÏóµÄËùÓз½·¨£º
    • insert(i, x) ----
ÔÚÖ¸¶¨Î»ÖòåÈëÒ»Ïî¡£µÚÒ»×Ô±äÁ¿ÊÇÒªÔÚÄÄÒ»¸öÔªËØÇ°Ãæ²åÈ룬ÓÃϱê±íʾ¡£ÀýÈ磬a.insert(0,
x)ÔÚÁбíÇ°Ãæ²åÈ룬a.insert(len(a), x)µÈ¼ÛÓÚa.append(x) ¡£
    • append(x) ---- µÈ¼ÛÓÚa.insert(len(a), x)
    • index(x) ---- ÔÚÁбíÖвéÕÒÖµx È»ºó·µ»ØµÚÒ»¸öֵΪx µÄÔªËصÄϱꡣûÓÐÕÒµ½Ê±³ö´í¡£
    • remove(x) ---- ´ÓÁбíÖÐɾȥµÚÒ»¸öֵΪx µÄÔªËØ£¬ÕÒ²»µ½Ê±³ö´í¡£
    • sort() ---- ¶ÔÁбíÔªËØÔÚԭλÅÅÐò¡£×¢ÒâÕâ¸ö·½·¨¸Ä±äÁÐ±í£¬¶ø²»ÊÇ·µ»ØÅÅÐòºóµÄÁÐ±í¡£
    • reverse() ---- °ÑÁбíÔªËØ·´Ðò¡£¸Ä±äÁÐ±í¡£
    • count(x) ---- ·µ»Øx ÔÚÁбíÖгöÏֵĴÎÊý¡£
ÄÚÖú¯Êý
    filter()
        filter(º¯Êý, ÐòÁÐ) -
·µ»ØÒ»¸öÐòÁУ¨¾¡¿ÉÄÜÓëÔ­À´Í¬ÀàÐÍ£©£¬ÐòÁÐÔªËØÊÇÔ­ÐòÁÐÖÐÓÉÖ¸¶¨µÄº¯Êýɸѡ³öÀ´µÄÄÇЩ£¬É¸Ñ¡¹æÔòÊÇ“º¯Êý(ÐòÁÐÔªËØ)=true”¡£filter()¿ÉÒÔ
ÓÃÀ´È¡³öÂú×ãÌõ¼þµÄ×Ó¼¯
           
    map()
        map(º¯Êý£¬ÐòÁÐ) - ¶ÔÖ¸¶¨ÐòÁеÄÿһÏîµ÷ÓÃÖ¸¶¨µÄº¯Êý£¬½á¹ûΪ·µ»ØÖµ×é³ÉµÄÁÐ±í¡£map() ¿ÉÒÔ¶ÔÐòÁнøÐÐÒþʽѭ»·
    reduce()
        reduce(º¯Êý, ÐòÁÐ) -
ÓÃÀ´½øÐÐÀàËÆÀÛ¼ÓÕâÑùµÄ²Ù×÷£¬ÕâÀïµÄº¯ÊýÊÇÒ»¸öÁ½¸ö×Ó±äÁ¿µÄº¯Êý£¬reduce()ÏȶÔÐòÁеÄÇ°Á½Ïîµ÷Óú¯ÊýµÃµ½Ò»¸ö


Ïà¹ØÎĵµ£º

python·ÃÎÊ sql server

½ñÌìÊÔÑéʹÓÃpythonÁ¬½Ó sql server ·þÎñÆ÷¡£ÎҼǵÃÒÔǰʹÓÃadoÁ¬½Óaccess·Ç³£Ë³Àû£¬µ«ÊǽñÌìʹÓÃadoÁ¬½Ósql server¾¹È»²»³É¹¦¡£ÔÚpythonÀïÃæµÄ³ö´íÐÅÏ¢¶¼ÏÔʾΪתÒÆÐòÁУ¬·ÑÁË°ëÌì¾¢²Å¸ãÃ÷°×£ºÎÞЧµÄÀà±ð×Ö·û´®¡£
ÊÇÁ¬½Ó×Ö·û´®Â𣿲âÊÔÁ˺ü¸¸ö È·ÈÏÎÞÎóµÄÊý¾Ý¿âÁ¬½Ó×Ö·û´®£¬Ò²ÊÇÈç´Ë ¡£ÉÏÍøËÑË÷£¬ÊÇÓпÉÄÜÊÇ comµÄÀà±ð×Ö ......

ѧϰpython½Å±¾ÓïÑԱʼǣ¨1£©

ptyhonºËÐıà³ÌµÚÈý°æµÄ×Ôѧ£¬Ö÷Ҫѧϰ±Ê¼Ç·¢Ï£º
µÚÒ»Õ£ºÊ¹ÓÃÈëÃÅ
ÈËÃÇΪʲôʹÓÃPYTHONÓïÑÔ£º
1¡¢Èí¼þÖÊÁ¿£»
2¡¢¿ª·¢ÕßЧÂÊ£»
3¡¢³ÌÐòµÄ¿ÉÒÆÖ²ÐÔ£»
4¡¢×é¼þ¼¯³É£»
5¡¢ÏíÊÜÀÖȤ£»
PYTHONÓïÑÔµÄȱµã£¬¾ÍÊÇËÙ¶ÈÂý¡£
ʹÓÃPYTHON¿ÉÒÔ×öЩʲô£º
1¡¢ÏµÍ³±à³Ì£»
2¡¢Óû§Í¼Ðνӿڣ»
3¡¢INTERNET½Å±¾£»
4¡¢×é¼þ¼¯³É£ ......

PythonÖ®¸Ð

´ÓÈ¥Ä껹û±ÏÒµ¾Í½Ó´¥Python£¬ÉÏÖÜÓÐЩÎÞÁÄÖØÐÂÔÙ¿´Ò»±é£¬·¢ÏÖÆäȷʵ²»´í¡£Óï·¨¼òµ¥£¬Ò»¸öÏÂÎç»ù±¾Á˽⣬ʹÓÃPydev²å¼þÔÚEclipseÖнøÐпª·¢»ù±¾ÉÏûÓÐÈκÎÕÏ°­¡£ÖصãÊÇÆäЧÂʺܸߣ¬²»Ðè±àÒëÖ±½ÓÔËÐС£±È½ÏÊʺϽøÐÐÊý¾ÝµÄÔ¤´¦Àí¡£²»´í£¬ÒÔºóÓлú»áºÃºÃÓÃÓᣠ......

´î½¨S60ÊÖ»ú¶ËPythonÈí¼þÔËÐÐ,¿ª·¢,·¢²¼Æ½Ì¨

µÚÒ»²½£º´î½¨ÊÖ»úÔËÐÐƽ̨
ÒªÔÚS60ÊÖ»úÉÏÔËÐÐPY¿ª·¢µÄÈí¼þ,Ê×ÏȾÍÒª´î½¨ÊÖ»úPYÔËÐл·¾³.ŵ»ùÑÇÊÖ»ú±¾Éí²»Ö§³ÖPython,ËùÒÔÒª°²×°Python²å¼þ.
PS£ºÒ»¶¨Òª°²×°ÔÚCÅÌ£¡ÎÒÒ»¿ªÊ¼×°E£¬½á¹û³öÏÖÁ˺ÜÑÏÖصÄÎÊÌ⣡²»¹ý,×î½üÍøÉÏ·¢ÏÖÓÐEÅÌ°æµÄÀ²,Äã¿ÉÒÔ×Ô¼ºÊÔÑéһϣ¬¹þ¹þ
PythonScriptShell_1_4_5_3rdEd.SIS
Pyth ......

PythonÖÐÊý¾Ý½á¹¹ Áбí Ôª×é ×Öµä ÐòÁÐ


Áбí
listÊÇ´¦ÀíÒ»×éÓÐÐòÏîÄ¿µÄÊý¾Ý½á¹¹£¬¼´Äã¿ÉÒÔÔÚÒ»¸öÁбíÖд洢һ¸ö ÐòÁÐ
µÄÏîÄ¿¡£¼ÙÏëÄãÓÐÒ»¸ö¹ºÎïÁÐ±í£¬ÉÏÃæ¼ÇÔØ×ÅÄãÒªÂòµÄ¶«Î÷£¬Äã¾ÍÈÝÒ×Àí½âÁбíÁË¡£Ö»²»¹ýÔÚÄãµÄ¹ºÎï±íÉÏ£¬¿ÉÄÜÿÑù¶«Î÷¶¼¶À×ÔÕ¼ÓÐÒ»ÐУ¬¶øÔÚPythonÖУ¬
ÄãÔÚÿ¸öÏîÄ¿Ö®¼äÓöººÅ·Ö¸î¡£
ÁбíÖеÄÏîÄ¿Ó¦¸Ã°üÀ¨ÔÚ·½À¨ºÅÖУ¬ÕâÑùPython¾ÍÖªµÀÄãÊÇ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ