Skip to content

Instantly share code, notes, and snippets.

@EdwinTai
Last active October 27, 2020 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EdwinTai/c8175d8eebdc8f8162add14763fc5eb9 to your computer and use it in GitHub Desktop.
Save EdwinTai/c8175d8eebdc8f8162add14763fc5eb9 to your computer and use it in GitHub Desktop.
# -*- 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