forked from werhereitacademy/Python_Modul_Week_2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathw2-q1.py
More file actions
31 lines (31 loc) · 915 Bytes
/
w2-q1.py
File metadata and controls
31 lines (31 loc) · 915 Bytes
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
students ={}
for i in range (1,3):
student = {input("Name, Surname? "):[int(input("midterm ")),int(input("final ")), int(input("oral "))]}
students.update(student)
print(students)
for i in students:
students[i].append(round(sum(students[i])/3))
print(students)
avg=[]
for i in students:
avg.append((students[i])[-1])
avg=[((students[i])[-1]) for i in students]
for i in students:
if (students[i])[-1]==max(avg):
print("Highest average grade: ",i, ",", max(avg))
Names=[]
for i in list(students.keys()):
i.split(" ")[0]
Names.append(i.split(" ")[0])
print(tuple(Names))
print("sorted names: ",sorted(Names))
Unseccesfull=[]
for i in students:
if (students[i])[-1]<70:
Unseccesfull.append(i)
print(set(Unseccesfull))
Unseccesfull=set(Unseccesfull)
for i in students:
if (students[i])[-1]<70:
Unseccesfull.add(i)
print("Unseccesfull students / ",Unseccesfull)