針對下列 Python 程式,執行 test(3) 後,其輸出為下列何者? def f(a, b): if a>b: a = a + b else: b = b -a return b, a def test(x): x, y = f(x, x+3) print(x+y)
A0
B3
C6正確答案
D9
答案與詳解
f(3,6):a=3,b=6,a<b 走 else,b=6-3=3,return (3,3);test 中 x,y=(3,3),印 x+y=6。
Examly 收錄 38 萬+ 道歷屆題目,每題都有像這樣的精選詳解。免費下載,立即開練。
