2 ms·
there is chinese python. http://reganmian.net/blog/2008/11/21/chinese-python-translating-a-programming-language/ http://reganmian.net/blog/2008/11/21/chinese-p
by fxj 7y ago
there is chinese python.
http://reganmian.net/blog/2008/11/21/chinese-python-translating-a-programming-language/ http://reganmian.net/blog/2008/11/21/chinese-python-translat...
I bet there are IoT devices out there that use it already.
For example:
#!/usr/bin/env zhpy
# 檔名: while.py
數字 = 23
運行 = 真
當 運行:
猜測 = 整數(輸入('輸入一個數字: '))
如果 猜測 == 數字:
印出 '恭喜, 你猜對了.'
運行 = 假 # 這會讓循環語句結束
假使 猜測 < 數字:
印出 '錯了, 數字再大一點.'
否則:
印出 '錯了, 數字再小一點.'
否則:
印出 '循環語句結束'
印出 '結束'
which translates to:
#!/usr/bin/env python
# File name: while.twpy
number = 23
running = True
while running:
guess = int(raw_input('Enter an integer : '))
if guess == number:
print 'Congratulations, you guessed it.'
running = False # this causes the while loop to stop
elif guess < number:
print 'No, it is higher than that.'
else:
print 'No, it is lower than that.'
else:
print 'The while loop is over'
print 'Done'