-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudentGrading.py
More file actions
75 lines (56 loc) · 1.68 KB
/
StudentGrading.py
File metadata and controls
75 lines (56 loc) · 1.68 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import statistics as s
admins = {'Python':'Pass123'}
students = {'Jeff':[78,76,93],'Alex':[92,76,88],'Sam':[66,77,88]}
def enterGrades():
sname = input('Student Name: ')
if sname in students:
print('Adding Grade...')
grade = input('Grade: ')
students[sname].append(int(grade))
else:
print('Student does not exist')
print(students)
def removestu():
nameremove = input('Enter the name of the student you want to remove: ')
if nameremove in students:
print('Removing Student:')
del students[nameremove]
else:
print('Student does not exist')
print(students)
def stuavg():
for eachStudent in students:
grades = students[eachStudent]
avgGrade = s.mean(grades)
print(eachStudent,'has an average grade of: ',avgGrade)
def main():
print('''
Welcome to Grade Central
[1] - Enter Grade
[2] - Remove Student
[3] - Student Average Grade
[4] - Exit
''')
options = input('What would you like to do today? (Enter a number) ')
if options == '1':
enterGrades()
elif options == '2':
removestu()
elif options == '3':
stuavg()
elif options == '4':
Exit()
else:
print('Not a valid choice! please try again')
login = input('Uname: ')
pwd = input('Password: ')
if login in admins:
if admins[login] == pwd:
print('Welcome',login)
while True:
main()
else:
print('Invalid Password, will detonate in 5 seconds!')
else:
print('Inavlid Usename')
#Just for Git testing