List students_list is read from input and has an even number of elements representing students participating in a competition. The elements of students_list are separated into halves. Integer slice length represents the number of students in each half.
- Assign slice_length with len(students_list) // 2 .
- Assign student team1 with a slice of students_list from the beginning up to and excluding index slice_length.
- Assign student_team2 with a slice of students_list from index slice length up to and including the end.
Click here for example \( \wedge \) Ex. If the input is:
Bly Ira Gio Ike
then the output is:
Number of students in each half: 2
All participants: ['Bly', 'Ira', 'Gio', 'Ike']
Team 1: ['Bly', 'Ira']
Team 2: ['Gio', 'Ike']
1 students_list \( = \) input( ).split()
2
3 ' 3 Your code goes here
4 slice_length \( = \) len(students_list) \( / / / 2 \)
5 student_team \( = \) = students_list[:students_list]
6 student_team \( 2= \) students_list[students_list:]
7 print(f'Number of students in each half: \{slice_length\}')
8 print(f'All participants: \{students_list\}')
9 print(f'Team 1: \{student_team1\}')
10 print(f'Team 2: \{student_team2\}')