Pythonȫջѧϰ_day001֪ʶµã
2018-10-26 05:29:11À´Ô´£º²©¿ÍÔ° ÔĶÁ ()
½ñÈÕ´ó¸Ù£º
1. ±äÁ¿¡£ ***** 2. ³£Á¿¡£** 3. ×¢ÊÍ¡£*** 4. »ù´¡Êý¾ÝÀàÐͳõʶ£¨int£¬str£¬bool£©. ***** 5. Óû§ÊäÈë input ***** 6. Á÷³Ì¿ØÖÆÓï¾äif¡£ *****
1. ±äÁ¿
±àÂ뷽ʽΪutf-8£º
# -*- encoding:utf-8 -*-
print('Hello Everyone') print(1+2+3+4+5) print((1 + 2 + 3 + 4 + 5) * 20 / 4) print(((1 + 2 + 3 + 4 + 5) * 20 / 4) * 5 / 2)
x = 1 + 2 + 3 + 4 + 5 print(x) y = x * 20 / 4 z = y * 5 / 2 print(y,z)
why what how where
x y z ¾ÍÊDZäÁ¿£º±äÁ¿¾ÍÊǽ«Ò»Ð©Êý¾ÝµÄÖмä½á¹ûÔÝ´æÆðÀ´£¬ÒÔ±ãºóÐø³ÌÐòµ÷Óá£
±äÁ¿ÈçºÎʹÓ㿶¨ÒåÒ»¸ö±äÁ¿µÄ¹æ·¶
1,±äÁ¿Ö»ÄÜÓÉÊý×Ö£¬×Öĸ£¬Ï»®ÏßÈÎÒâ×éºÏ¡£ 2£¬²»ÄÜÒÔÊý×Ö¿ªÍ·¡£ 3£¬²»ÄÜÊÇpythonÖеĹؼü×Ö¡£ ['and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'with', 'yield'] 4£¬±äÁ¿ÒªÓÐÃèÊöÐÔ¡£ name = 'alex' age = 'taibai' 5£¬±äÁ¿²»ÄÜʹÓÃÖÐÎÄ¡£ 6£¬±äÁ¿²»Äܹý³¤¡£ fdjksaflsdsfdfjkl = 'wusir' 7, ±äÁ¿²»ÄÜʹÓÃÆ´Òô¡£ 8£¬¹Ù·½ÍƼöʹÓ㺠ÍÕ·åÌå AgeOfOldboy = 1000 Ï»®Ïß age_of_oldboy = 1000
ÔÚÄÄÀïÓ¦Óãº
¹ý³¤µÄ½á¹û£¬ÎÒÈñäÁ¿´úÌ棬ʹÓÃÆðÀ´·½±ã£¬ÇåÎú¡£
¼õÉÙÖظ´ÂÊ¡£
±äÁ¿µÄÁ·Ï°Ì⣺
1age = 2 # False a_ = 45 # True _ = 123 # True _$ = 333 # False ÓÐ$ÌØÊâ×Ö·û __ = 'alex' # True 123 = 666 # False a1b = 45 # True _ _ = 6666 # True
age1 = 12 age2 = age1 age3 = age2 age2 = 26 print(age1,age2,age3) # 12 26 12 12 26 26 26 26 26
³£Á¿ Π£¬ÑôÀúÉúÈÕ£º12.28£¬ÐÂÖйú³ÉÁ¢ 1949 ³£Á¿:Ò»Ö±²»±äµÄÁ¿¡£pythonÖб¾À´Ã»Óг£Á¿ name = 'alex' NAME = 'wusir' pythonÖеij£Á¿£º½«±äÁ¿È«²¿´óд¡£ ÍùÍù³£Á¿»á·ÅÔÚÎļþ×îÉÏÃæ¡£
×¢ÊÍ
ÎÄÑÔÎÄÖлáÓÐһЩÄÑÒÔÀí½âµÄ»òÕß»ÞɬÄѶ®µÄ³ÉÓï µä¹Ê£¬ ¡¡¡¡ÕâÑùµÄ³ÉÓï»òÕßµä¹Ê»áÓÐһЩע½â¡£ ×¢ÊÍ£º¶Ô´úÂë½âÊÍ˵Ã÷£¬°ïÖú×Ô¼º»òÕß±ðÈËÀí½â¡£ ÔõôÓã¿ µ¥ÐÐ×¢ÊÍ £º# ¶àÐÐ×¢ÊÍ£º'''±»×¢ÊÍÄÚÈÝ''' """±»×¢ÊÍÄÚÈÝ""" ×¢ÊͲ»ÄÜÿÐж¼Óã¬ÔÚһЩÖص㣬ÄÑÒÔÀí½âµÄµØ·½Ê¹Óá£
Êý¾ÝÀàÐ͵ijõʶ¡£
ʲôÊÇÊý¾ÝÀàÐÍ?
ÈËÀà¸ø»úÆ÷»®·ÖµÄһЩÊý¾Ý£ºÊý×ÖÀàÐÍ£¬×Ö·û´®ÀàÐÍ£¬boolÖµ£¬¶ÔÓë´í¡£µÈµÈ¡£
Êý×ÖÀàÐÍ£º ¡¡¡¡float ¸¡µãÐÍ¡£ i = 3.1415 ¡¡¡¡int ÕûÐÍ¡£ i = 36 i2 = 100 ¡¡¡¡ÓÃÀ´¼ÆËã»òÕß¼ÆÊý¡£ ×Ö·û´®ÀàÐÍ¡£pythonÖз²ÊÇÓÃÒýºÅÒýÆðÀ´µÄ¾ÍÊÇ×Ö·û´®¡£ ¡¡¡¡s1 = 'alex' ¡¡¡¡s2 = "alexÀî¸ç1" µ¥Ë«ÒýºÅÅäºÏʹÓà ¡¡¡¡s3 = "I'm taibai" ¡¡¡¡print(s3) msg = """´²Ç°Ã÷Ô¹⣬ ÒÉÊǵØÉÏ˪""" print(msg)
×Ö·û´® µÄ + ×Ö·û´®¿ÉÒÔÓë×Ö·û´®Ïà¼Ó ×Ö·û´®µÄÆ´½Ó s1 = 'alex' s2 = 'sb' print(s1 + s2) ×Ö·û´®¿ÉÒÔÓëÊý×ÖÏà³Ë s3 = '¼áÇ¿' print(s3*8) boolÖµ¡£ print(True) print(False) print(2 > 1)
input ³öÀ´µÄÊý¾ÝÈ«²¿¶¼ÊÇ×Ö·û´®ÀàÐÍ¡£
Óû§ÐèÒªÊäÈëÓû§ÃûÃÜÂ루qqµÇ½£©£¬´Ëʱ¾ÍÐèÒªÓû§ÊäÈëinput print('18') print(18) name = input('ÇëÊäÈëÓû§Ãû£º') age = input('ÇëÊäÈëÄêÁ䣺') print(name) print(type(age)) # ÅжϴËÊý¾ÝµÄÊý¾ÝÀàÐÍ print('´ËÓû§µÄÐÕÃûÊÇ' + name +',' + '´ËÓû§µÄÄêÁäÊÇ' + age)
if Ìõ¼þÓï¾ä¡£
³õʶ½á¹¹£º if Ìõ¼þ: Ö´Ðнá¹û(´úÂë¿é)
# µÚÒ»Öֽṹ£ºµ¥¶Àif ''' print(111) if 3 > 4 : print(222) print(333) ''' # µÚ¶þÖֽṹ£ºif else ''' choice = int(input('ÇëÊäÈëÄã²ÂµÃ´óС£º')) if 0<choice < 4: print('Äã²ÂµÃÊÇС') else: print('Äã²ÂµÃÊÇ´ó') ''' # µÚÈýÖֽṹ£º ¶à¸öÌõ¼þÑ¡1¸ö if elif elif ..... ''' choice = int(input('ÇëÊäÈëÄã²ÂÊý×Ö£º')) if choice == 3: print('ÎÒÇëÄã³Ô·¹') elif choice == 4: print('ÎÒÇëÄãÏ´Ôè') elif choice == 6: print('ÎÒÇëÄã´ó±¦½£') ''' # µÚËÄÖֽṹ£º if elif elif ..... else ''' choice = int(input('ÇëÊäÈëÄã²ÂÊý×Ö£º')) if choice == 3: print('ÎÒÇëÄã³Ô·¹') elif choice == 4: print('ÎÒÇëÄãÏ´Ôè') elif choice == 6: print('ÎÒÇëÄã´ó±¦½£') else: print('Õⶼû²Â¶Ô£¬Õ汿...') ''' # if ǶÌ× username = input('ÇëÊäÈëÓû§Ãû£º') password = input('ÇëÊäÈëÃÜÂ룺') if username == 'alex': if password == '123': print('µÇ½³É¹¦') else: print('ÃÜÂëÊäÈëÓÐÎó') else: print('Óû§ÃûÊäÈëÓÐÎó')
±êÇ©£º
°æȨÉêÃ÷£º±¾Õ¾ÎÄÕ²¿·Ö×ÔÍøÂ磬ÈçÓÐÇÖȨ£¬ÇëÁªÏµ£ºwest999com@outlook.com
Ìرð×¢Ò⣺±¾Õ¾ËùÓÐתÔØÎÄÕÂÑÔÂÛ²»´ú±í±¾Õ¾¹Ûµã£¬±¾Õ¾ËùÌṩµÄÉãÓ°ÕÕƬ£¬²å»£¬Éè¼Æ×÷Æ·£¬ÈçÐèʹÓã¬ÇëÓëÔ×÷ÕßÁªÏµ£¬°æȨ¹éÔ×÷ÕßËùÓÐ
ÉÏһƪ£ºset ¼¯ºÏ
ÏÂһƪ£ºRequestsÅÀ³æ
- python3»ù´¡Ö®¡°ÊõÓï±í£¨2£©¡± 2019-08-13
- python3 Ö® ×Ö·û´®±àÂëС½á£¨Unicode¡¢utf-8¡¢gbk¡¢gb2312µÈ 2019-08-13
- Python3°²×°impala 2019-08-13
- С°×ÈçºÎÈëÃÅ Python ÅÀ³æ£¿ 2019-08-13
- python_×Ö·û´®·½·¨ 2019-08-13
IDC×ÊѶ£º Ö÷»ú×ÊѶ ×¢²á×ÊѶ ÍйÜ×ÊѶ vps×ÊѶ ÍøÕ¾½¨Éè
ÍøÕ¾ÔËÓª£º ½¨Õ¾¾Ñé ²ß»®Ó¯Àû ËÑË÷ÓÅ»¯ ÍøÕ¾Íƹã Ãâ·Ñ×ÊÔ´
ÍøÕ¾ÁªÃË£º ÁªÃËÐÂÎÅ ÁªÃ˽éÉÜ ÁªÃ˵ãÆÀ Íø׬¼¼ÇÉ
ÐÐÒµ×ÊѶ£º ËÑË÷ÒýÇæ ÍøÂçÓÎÏ· µç×ÓÉÌÎñ ¹ã¸æ´«Ã½
ÍøÂç±à³Ì£º Asp.Net±à³Ì Asp±à³Ì Php±à³Ì Xml±à³Ì Access Mssql Mysql ÆäËü
·þÎñÆ÷¼¼Êõ£º Web·þÎñÆ÷ Ftp·þÎñÆ÷ Mail·þÎñÆ÷ Dns·þÎñÆ÷ °²È«·À»¤
Èí¼þ¼¼ÇÉ£º ÆäËüÈí¼þ Word Excel Powerpoint Ghost Vista QQ¿Õ¼ä QQ FlashGet ѸÀ×
ÍøÒ³ÖÆ×÷£º FrontPages Dreamweaver Javascript css photoshop fireworks Flash
³ÌÐòÉè¼Æ£º Java¼¼Êõ C/C++ VB delphi
- Photoshop»æÖÆÁ¢Ìå·ç¸ñµÄ΢Ц±íÇé
- PSÎÄ×ÖÌØЧ½Ì³Ì£ºÖÆ×÷¹«Â·ÉϸöÐÔµÄÍ¿Ñ»
- PhotoshopÉè¼Æ¾í±ßЧ¹ûµÄ±äÐνð¸ÕµçÓ°
- PSÉ«²ÊÐÞ¸´½Ì³Ì£ºÀûÓÃÉ«½×¹¤¾ß¿ìËÙ¸øºì
- PS°ë͸Ã÷ÎïÌå¿Ùͼ£ºÀûÓÃͨµÀÑ¡Çø¹¤¾ß¿Ù
- PSº£±¨Éè¼Æ¼¼Çɽ̳̣ºÑ§Ï°ÖÆ×÷¸öÐԵč
- PSͼƬÌØЧÖÆ×÷½Ì³Ì£ºÑ§Ï°¸øÌúËþͼƬÖÆ
- ѧϰÓÃphotoshop°Ñ»ë×ǵĺ£Ë®ÕÕƬºóÆÚ
- PS¹Å·çÕÕƬ½Ì³Ì£º¸ø¹Å·çÃÀÅ®´òÔì³öÅ®ÏÀ
- PS¸öÐÔÈËÎﺣ±¨ÖÆ×÷£ºÉè¼Æ´´ÒâʱÉеIJ£
- ·ÖÏí ¡¶ÀûÓÃPython½øÐÐÊý¾Ý·ÖÎö(µÚ¶þ°æ
- µÚÒ»Õ£ºÕýÔò±í´ïʽ
- ¡¶Python½ðÈÚ´óÊý¾Ý·ÖÎö¡·ÖÐÎÄ°æPDF+Ó¢
- PythonÓÐÄÄЩÓÐȤµÄ´úÂëÄØ£¬ÕâЩ´úÂëÈÃ
- PandasÊý¾ÝÈ¥ÖغͶÔÖظ´Êý¾Ý·ÖÀà¡¢ÇóºÍ
- kettle°²×°²¿Êð¼°Ô¶³ÌÖ´ÐÐ
- ¿´ÈÕ±¾µçÓ°ÕæÍ´¿à£¬±¾À´¾ÍÌý²»¶®£¡»¹Ã»
- »ùÓÚpythonµÄÖÖ×ÓËÑË÷ÍøÕ¾£¬Ä㶮µÃ£¡
- ÀûÓÃPython»Í¼£¬Ç§±äÍò»¯£¬¸÷Öֻͼ¼¼
- python ¶ÔUnicode½âÂë