如果python有兩個函數的函數名與參數列表都相同那么調用該函數時,哪個函數在后,則哪個被最終調用。
舉例如下:
def test(): print "before hello" def test(): print "after hello" if __name__ == '__main__': test()
結果:
def test(): print "after hello" def test(): print "before hello" if __name__ == '__main__': test()
結果: