Python程序,该程序将循环遍历数组并将所有奇数学生放入一个名为“group1”的新数组中

2024-04-19 18:07:55 发布

您现在位置:Python中文网/ 问答频道 /正文

存储20个学生数组的程序。把他们分成两组进行一次小组活动。编写一个Python程序,在数组中循环并将所有奇数学生放入一个名为group1的新数组中,而将偶数学生放入一个名为group2的新数组中需要帮助

pupil=  []
numpupil = input('Number of Pupils: ')
for #need help with the for loop and continuing onward from this
    pupil[index] = input("Pupil  " + str(pupil))

Tags: of程序numberforinput数组need学生