Python學習 - 面試題:交換兩個數字

# coding: utf-8 # 面試題:交換兩個數字 a = 6 b = 100 # solution 1 # c = a # a = b # b = c # solution 2 # a = a + b # b = a - b # a = a - b # solution 3 a, b = b, a print a, b
相關文章
相關標籤/搜索