Writing Python-3 program in Chinese. 用中文寫 Python-3 程式。


有沒有試過用 中文 寫程式, Python-3 除了 約 30個 關鍵字不可用中文之外, 其他部分允許程式員使用中文(任何使用 Unicode 編碼的語言皆可)。 中文 是我最流利(fluent)的語言, 推薦你也來試試看。 會有意想不到的收穫喔!

from turtle import *

sayHello= 'Hello, World!'

print(sayHello)

for i in range(100):
    forward(100)
    left(170)

penup()
goto(0,+100)

pendown()
write(sayHello)

mainloop()
        
from turtle_tc import *

問候語= '你好,全世界!'

印(問候語)

for i in 範圍(100):
    前進(100)
    左轉(170)

提筆()
前往(0,+100)

下筆()
寫(問候語)

主迴圈()
        

執行本程式需要 turtle_tc 模組,
You can get turtle_tc.py here
https://github.com/renyuanL/pythonTurtleInChinese



沒有留言:

張貼留言