類似_xxx和__xxx這樣的函式或變數就是非公開的(private),不應該被直接引用,比如_abc,__abc等;
# private私有函式 def _private_1(name): return 'Hello,%s'%name def _private_2(name): return 'Hi,%s'%name # public公開函式 def greeting(name): if len(name) > 3: return _private_1(name) else: return _private_2(name) print(greeting('frank'))