Python中的任何序列(可迭代的对象)都可以通过赋值操作进行拆分,包括但不限于元组.列表.字符串.文件.迭代器.生成器等. 元组拆分 元组拆分是最为常见的一种拆分,示例如下: p = (4, 5) x, y = p print(x, y) # 4 5 如果写成 x, y, z = p 那么就会抛出ValueError异常:"not enough values to unpack (expected 3, got 2)" 如果写成 p = (4, 5, 6) x, y = p 那么就会
public static void main(String[] args) { List<Integer> taskList = new ArrayList<>(); for (int i = 1; i <= 52; i++) { taskList.add(i); } int total = taskList.size(); int threadNum = 5; int remaider = total % threadNum; // 计算出余数 int number =