Question: Using Dictionary: To complete a project, 1 2 students ( S 1 to S 1 2 ) in a class are grouped into 3 groups

Using Dictionary: To complete a project, 12 students ( S 1 to S 12) in a class are grouped into 3 groups (G1 to G3). Students are divided evenly in the sequence of their student IDs. Write a Python program (named YourName_SID_Lab10_3.py) to complete below tasks:
Start with a list holding all student IDs, i.e.['S1','S2',...'S12']. Create this list with a for loop.
Use slice technique to separate students in different lists and assign them to each group in a dictionary as values.
Display the whole dictionary by print() function.
Sample Program Output:
{'G1': ['S1','S2','S3','S4'],'G2': ['S5','S6','S7','S8'],'G3': ['S9','S10','S11','S12']}
END
Using Dictionary: To complete a project, 1 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!