-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice 2.py
More file actions
55 lines (40 loc) · 1.98 KB
/
Copy pathpractice 2.py
File metadata and controls
55 lines (40 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# def __str__(self):
# return '{} by {}. ${}. [{}]'.format(self.title, self.author, self.price, self.book_id)
# with open("University Admission Procedure\Stage 4 - Applicant_list_example.txt", "r") as f:
# applicants = []
# subjects_dict = {"Biotech": [], "Chemistry": [],
# "Engineering": [], "Mathematics": [], "Physics": []}
# for i in f:
# student = list(i.strip().split(" "))
# student = [student[0] + " " + student[1], *student[2:]]
# applicants.append(student)
# applicants.sort(key=lambda x: (-float(x[1]), x[0]))
# physics, chemistry, math, computer science
# num = int(input()) # x number of applicants to be accepted
# for applicant in applicants:
# for subject in applicant:
# def function():
# index = applicant[:][:].index(subject)
# if len(subjects_dict[subject]) < num:
# this_set = [*applicant[:2], subject]
# subjects_dict[subject].append(this_set)
# elif len(subjects_dict[applicant[index+1]]) < num:
# this_set = [*applicant[:2], applicant[index+1]]
# subjects_dict[applicant[index+1]].append(this_set)
# elif len(subjects_dict[applicant[index+2]]) < num:
# this_set = [*applicant[:2], applicant[index+2]]
# subjects_dict[applicant[index+2]].append(this_set)
# if subject == "Biotech" and applicant.index(subject) == 2:
# function()
# elif subject == "Chemistry" and applicant.index(subject) == 2:
# function()
# elif subject == "Engineering" and applicant.index(subject) == 2:
# function()
# elif subject == "Mathematics" and applicant.index(subject) == 2:
# function()
# elif subject == "Physics" and applicant.index(subject) == 2:
# function()
# for key, value in subjects_dict.items():
# print("\n" + key)
# for i in value:
# print(" ".join(i[:-1]))