python - How do I make a new array from values and arrays, without the new array containing an array
问题描述
I have these variables:
x = 1
y = [2, 3, 4]
z = 5
I want to add them all to a new array (something like this):
a = [x, y, z]
Now a
is [1, [2, 3, 4], 5]
However, I want a
to be [1, 2, 3, 4, 5
]
What's the most concise way to accomplish that?
解决方案
推荐阅读
- c - 除以 12 和 an/3 除以 n/4 有什么区别
- python - 贝塞尔图返回空白数据框
- asp.net-core - 如何将 ViewModel 中存在的列表绑定到单选按钮等输入字段
- typescript - 在针对扩展未定义进行测试时,基于输入参数的打字稿条件返回类型未按预期工作
- javascript - 我想将输入的数字添加到一个数组中,然后暂时将它们加在一起,但我不断得到未定义的数组?javascript html
- javascript - 如何使用数组替换部分字符串
- python - 在另一个脚本中使用类中的变量
- javascript - 使用 react.js 在 Visual Studio 中键入“npm start”时出错
- python - 使用 Parquet 文件处理 Arrow 中的 UUID 值
- angular - 无法在 Html 中显示来自 API 的图像(使用角度 7)