|
|
考試題目 |
|
(2) | 1. 請問底下程式執行時姓名和年齡分別是?
def P(name, age = 35): print('姓名:',name) print('年齡:',age) return
P(age = 50, name = 'Ruby') (1) |
| (1) | Ruby,35 |
| (2) | Ruby,50 |
| (3) | 35,Ruby |
| (4) | 50,Ruby |
| | |
(1) | 2. list = [1,2,3,4,5],經過下列哪行程式,會讓 list = [1,2,3,5] (2) |
| (1) | list.pop(3) |
| (2) | list.pop() |
| (3) | list.pop(4) |
| (4) | list.pop(5) |
| | |
(2) | 3. lt = [5,20,10,0,15,25,30],執行下列哪行程式,會讓 lt = [0, 5, 10, 15, 20, 25, 30] (3) |
| (1) | lt.reverse() |
| (2) | lt.sort() |
| (3) | lt.extend() |
| (4) | lt.clear() |
| | |
(1) | 4. lt = [5,20,10,0,15,25,30],執行下列哪行程式,會讓 lt = [30, 25, 15, 0, 10, 20, 5] (4) |
| (1) | lt.reverse() |
| (2) | lt.sort() |
| (3) | lt.extend() |
| (4) | lt.clear() |
| | |
|
|
|
|
|
|