📌  相关文章
📜  python将列表中的每个元素除以一个数字 - Python代码示例

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

代码示例1
# Example usage using list comprehension:
# Say you want to divide every number in your_list by some number
your_list = [10,20,30,40,50,60,70,80,90]
new_list = [x / 10 for item in your_list]

print(new_list)
--> [1,2,3,4,5,6,7,8,9] # Each number divided by 10