📜  item[0]: (i + 1) * 2 for i, item in (sort_loc) - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:24.433000             🧑  作者: Mango

代码示例1
def double_stuff(a_list):
    """ Overwrite each element in a_list with double its value. """
    for (idx, val) in enumerate(a_list):
        a_list[idx] = 2 * val

things = [2, 5, 9]
double_stuff(things)
print(things)