Pythonを勉強して8日目です。

6334 ワード

独学していつも方向が探し出せないで、堅持し続けてどのみち収穫します。
はい、http://wiki.woodpecker.org.cn/moin/ZqQuickIntoPyこのページでいい情報を見つけました。変えてください。
「Quick Python Script Explanion for Programers」:
Python
 

  
  
  
  
  1. # _*_ coding: utf-8 _*_ #
  2. #From http://coffeeghost.net 
  3.  
  4. import os 
  5.  
  6. def main(): 
  7.     print 'Hello world!' 
  8.  
  9.     print "This is Alice's greeting." 
  10.     print 'This is Bob\'s greeting.' 
  11.  
  12.   foo(5, 10)
  13.  
  14.     print '=' * 10 
  15.     print 'Current working directory is ' + os.getcwd() 
  16.  
  17.  
  18.     counter = 0 
  19.     conuter += 1 
  20.  
  21.  
  22.     food = ['appses''oranges''cats'
  23.  
  24.     for i in food: 
  25.         print 'I like to eat ' + i 
  26.  
  27.  
  28.     print 'Count to ten:' 
  29.     for i in range(10): 
  30.         print i 
  31.  
  32.  
  33.     def foo(param1, secondParam): 
  34.         res = param1 + secondParam 
  35.  
  36.         print '%s plus %s is equal to %s' % (param1, secondParam, res) 
  37.  
  38.         if res < 50
  39.             print 'foo' 
  40.  
  41.         elif (res >= 50and ((param1 == 42or (secondParam == 24)): 
  42.             print 'bar' 
  43.  
  44.         else
  45.             print 'moo' 
  46.  
  47.         return res # This is a one-line comment. 
  48.         '''A multi- 
  49. line string, but can also be a multi-line comment.''' 
  50.  
  51. if __name__ == '__main__'
  52.     main() 
中国語バージョンは下図の通りです。
 

Python