pythonµÄÁé»î
ÏîÄ¿ÐèÒª£¬¸Õ¸Õ½Ó´¥python¡£
½ñÌì¿´Êé¿´µ½a>b==c £¬a,b,cΪinteger
ÔÚC/C++/C#ÖУ¬a>bΪboolean,²»¿ÉÓëinteger±È½ÏÏàµÈ
µ«python a>b==cµÈЧÓÚ((a>b)&&(b==c))
ÔÚpythonÖеÄд·¨ÊÇa>b and b==c
Ïà¹ØÎĵµ£º
>>> import string
>>> s='adbecf'
>>>
tt=string.maketrans("abc","ABC")
>>> s.translate(tt,"")
'AdBeCf'
>>>
s.translate(tt,"")
ºóÃæµÄÄǸö¿Õ×Ö·û´´¾ÍÊÇÄãҪɾ³ýµÄ×Ö·û£¬±ÈÈçҪɾ³ý»»ÐоÍÊÇs.translate(tt,"\n&q ......
c´úÂë:
int x = a>b?6,6;
ÕâÖÖÓï¾äPythonÖÐÒ²ÓУº
¿ÉÒÔͨ¹ýand or×éºÏÀ´ÊµÏÖ¡£¸öÈËÈÏΪÕâÖÖÓï¾ä¾¡Á¿ÉÙµãºÃ¡£
python°ÑÕâÀàÐ͵ŦÄÜ·¢Ñï¹âÁË´ó¡£µ«ÊÇÓÉÓÚÕâÖÖ×éºÏ±È½ÏÈÆ£¬ËùÒÔÓÐʱºò±È½Ï¾À½á:
±ÈÈç:
5 or 6 and 6 ·µ»Øwhat?
0 or 5 ·µ»Øwhat?
8 and 7 ·µ»Øwhat?
ÓÚÊÇÕûÀíÁËÏ£º
1.pyhon ÖÐÓ ......
Ä£°åÊǼòµ¥µÄÎı¾Îļþ£¬Ëü¿ÉÒÔÊÇhtml¸ñʽ»òÊÇxml,csvµÈ¸ñʽµÄ
Ä£°å°üÀ¨±äÁ¿£¬À¨Ëü»á±»ÖµËùÌæ´úµ±ÔËÐÐʱ£¬ÒÔ¼°±êÇ©Ëü¿ØÖÆÄ£°åµÄÂß¼ÔËËãÈçif,elseµÈ
ÏÂÃæÊÇÒ»¸ö¼òµ¥µÄÄ£°å£¬ÎÒÃǽ«»á¶ÔËü×öÏêϸµÄ˵Ã÷
{% extends "base_generic.html" %}
{% block title %}{{ section.title }}{% endblock %}
{% block content %}
< ......
1¡¢PythonÖ®ÖÐΨһÄÚ½¨µÄÓ³ÉäÀàÐ;ÍÊÇ×ֵ䣨Dictionary£©¡£×ÖµäÖеÄÖµ²¢Ã»ÓÐÌØÊâµÄ˳Ðò£¬µ«ÊǶ¼°´Õչؼü×Ö£¨Key£©½øÐд洢£¬¹Ø¼ü×Ö¿ÉÒÔÊÇÊý×Ö¡¢×Ö·û´®£¬ÉõÖÁÊÇÔª×飨Tuple£©¡£
2¡¢×ÖµäµÄÓï·¨£º×ÖµäÃû = {'¼ükeys':'Öµvaules','¼ükeys':'Öµvaules','¼ükeys':'Öµvaules',...}£¬×ÖµäÖаüº¬ºÜ¶à¶Ô£¨³ÆΪÌõÄ¿items£©£¬ÓÉ£¨keys£ ......