函數(shù)描述:The function scramble takes a non-empty tup in which no number is greater than its own index, and returns a tup of the same lenght. Each number is the argument is treated as a backward index from its own position to a point earlier in the tup. The result at each position is found by counting backward from the current position according to this index.What's the value of (scramble tup) where tup is (1 1 1 3 4 2 1 1 9 2)Answer: (1 1 1 1 1 4 1 1 1 9)
1 回答

楊__羊羊
TA貢獻1943條經(jīng)驗 獲得超7個贊
一開始我也沒看懂,后來看了函數(shù)的定義才弄明白了,新的列表的每個子元素是原來每個對應(yīng)子元素的向前追溯其值個.1就代表本身,2就是前一個.
- 1 回答
- 0 關(guān)注
- 778 瀏覽
添加回答
舉報
0/150
提交
取消