Last active
October 27, 2020 06:05
-
-
Save EdwinTai/c8175d8eebdc8f8162add14763fc5eb9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
#參考https://blog.csdn.net/handsomekang/article/details/9397025 | |
#當資料庫中文字長度限制判斷時需要特別注意,要配合資料庫datatype | |
#許功蓋 大五碼 | |
print(len(u"測試".encode("utf-8")))#一個中文長度3 | |
print(len(u"測試".encode("Big5")))#一個中文長度2 | |
print(len(u"測試"))#unicode | |
#計算機 | |
print(3+2) | |
print(3-2) | |
print(3*2) | |
print(3/2) | |
print(3%2) | |
print(3**2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment