#coding=utf8'''Python語句中基本的規則與特殊字符:1.井號(#)表示之后的字符為Python注釋2.換行(/n)是標準的行分隔符(通常一個語句一行)3.反斜線(/)繼續上一行4.分號(;)將兩個語句連接在一行中5.冒號(:)將代碼塊的頭和體分開6.語句(代碼塊)用縮進快的方式體現7.不同的縮進深度分隔不同的代碼塊8.Python文檔以模塊的形式組織'''#this is a commentfrom pyasn1.type.univ import Nullten=10 #define variable tenstr='hello' #define string type variable#使用反斜線分隔符if ten==10 and /str!=Null: #使用冒號將代碼的頭和體分開 PRint ten,str #同一行寫多個語句import sys; x='foo'; sys.stdout.write(x+'/n')
新聞熱點
疑難解答