What is a procedure?
A procedure is a named group of code that has paramaters and return values. Procedures are known as methods or functions depending on the language.
A procedure executes the statements within it on the parameters to provide a return value.
What are parameters?
Paramaters are input values of a procedure that are specified by arguments.Arguments specify the values of the parameters when a procedure is called.
By creating theses algorithms the readibility of code increases and the complexity decreases. This is becasue a function’s name can tell the reader what action it will perform, and by calling it, the code becomes more clean and easy to understand.
Procedures are used to create algorthims that can perform certain actions or return values. When a procedure returns a value, theis information must be stored in a variable for later use. However some procedures like the MOVE_FORWARD() perform an action, and don’t return a value. The image above provides an example of where procedures that don’t output a value would be used.
A 60$ item recieves a 20% discount and taxed at 8%.
PROCEDURE applyDiscount(cost, percentDiscounted)
{
temp ← 100 - percentDiscounted
temp← temp/ 100
cost ← cost *temp
RETURN(cost)
}
price ← applyDiscount(60, 20)
This is how we get the final price with the discount by calling the procedure and assigning it to the price variable.
PROCEDURE applyTax(cost, percentTaxed)
{
temp ← 100 + percentTaxed
temp← temp/ 100
cost ← cost *temp
RETURN(cost)
}
price ← applyTax(price, 8)
This applys the 8% tax to the price determined after the discount.
Given the applyTax procedure above: How would you call the procedure to get it to find the price using cost = 50, and percentTaxed = 10, and what value will it return?
#code here
price ← applyTax(50, 10)
#will return 55
# Defining Functions
#
# def function_name(parameter1, parameter2, etc..):
# code here...
#
# return return_value;
# return the value of parameter1 plus parameter2;
def add(parameter1, parameter2): # creates a function that takes in two parameters
solution = parameter1 + parameter2; # sets solution to the sum of parameter1 and parameter2
return solution; # return solution
print(add(5, 5)); # prints the return value of add(5,5)
# Code here
def subtract(a, b):
return abs(a - b)
print(subtract(-2, 1))
3
# Defining Classes
class person:
def __init__(self, name, age, ): # constructor
self.name = name;
self.age = age;
def getName(self): # method to create get name
return self.name;
def getAge(self): # method to create get age
return self.age;
def setName(self, name): # method to create set name
self.name = name;
def setAge(self, age): # method to create set age
self.age = age;
def yearOlder(self): # method to increment age by 1
self.age += 1;
def __str__(self): # method that returns a string when the object is printed
return (f"My name is {self.name} and I am {self.age} years old.")
Person1 = person("John Doe", 15);
print(Person1)
print(Person1);
My name is John Doe and I am 15 years old.
My name is John Doe and I am 15 years old.
class car:
def __init__(self, model, name, price):
self.model = model
self.name = name
self.price = price
car1 = car("Honda Civic", 2018, 13000)
car2 = car("Toyota Prius", 2023, 28000)
car3 = car("Chevrolet Impala", 2020, 22000)
class Grade:
def __init__(self, classname, grade):
self.classname = classname
self.grade = grade
def get_name(self):
return self.classname
def get_grade(self):
return self.grade
def change_name(self, newname):
self.classname = newname
def change_grade(self, newgrade):
self.grade = newgrade
class Student:
def __init__(self, email, name, grade_dict):
self.grade_list = []
self.email = email
self.name = name
for class_name in grade_dict:
self.grade_list.append(Grade(class_name, grade_dict[class_name]))
def add_grade(self, classname, grade):
self.grade_list.append(Grade(classname, grade))
def get_grade(self, index):
if 0 <= index < len(self.grade_list):
return self.grade_list[index]
else:
return None
def set_grade(self, classname, new_grade):
grade_found = False
for grade in self.grade_list:
if classname == grade.get_name():
grade.change_grade(new_grade)
grade_found = True
break
if not grade_found:
print("Error: Class name not found")
def get_email(self):
return self.email
def get_name(self):
return self.name
def set_name(self, new_name):
self.name = new_name
def set_email(self, new_email):
self.email = new_email
def get_information(self):
info = {}
info["Name"] = self.name
info["Email"] = self.email
gradedict = {}
for grade in self.grade_list:
gradedict[grade.get_name()] = grade.get_grade()
info["Grades"] = gradedict
return info
students = []
print('Welcome to Student Database!')
finished = False
while not finished:
print('A: Add Student(s)\nB: Update Student Grades\nC: Get Student Grade\nD: Get Highest Grade\nE: Get Passing Students\nF: Get Student Email')
usercannotread = True
while usercannotread:
option = input('What would you like to do?: ')
if option not in ['A', 'B', 'C', 'D', 'E', 'F']:
print('ERROR, there is no option ' + option)
else:
usercannotread = False
if option == 'A':
add_more_students = 'yes'
while add_more_students.lower() == 'yes':
student_name = input('Enter Student Name: ')
student_email = input('Enter Student Email: ')
student_grades = {}
done = False
while not done:
class_name = input('Enter Class Name (or type "done" to finish adding grades for this student): ')
if class_name.lower() == 'done':
done = True
else:
gradeIsValid = False
while not gradeIsValid:
grade = input(f'Enter Grade for {class_name}: ')
grade = int(grade)
gradeIsValid = True
student_grades[class_name] = grade
student = Student(student_email, student_name, student_grades)
students.append(student)
add_more_students = input('Do you want to add another student? (yes/no): ')
print('New Student List: ')
for student in students:
print(student.get_information())
elif option == 'B':
student_name = input('Enter Student Name: ')
student_found = False
for student in students:
if student.get_name() == student_name:
student_found = True
class_name = input('Enter Class Name to update grade: ')
if class_name in student.get_information()['Grades']:
new_grade = input(f'Enter new Grade for {class_name}: ')
new_grade = int(new_grade)
student.set_grade(class_name, new_grade)
print(f'Updated grade for {student_name} in class {class_name}')
else:
print(f'Class {class_name} does not exist for {student_name}')
break
if not student_found:
print('Student is not in the database.')
print('New Student List: ')
for student in students:
print(student.get_information())
elif option == 'C':
student_name = input('Enter Student Name: ')
class_name = input('Enter Class Name (or type "all" for all grades): ')
student_found = False
for student in students:
if student.get_name() == student_name:
student_info = student.get_information()
if class_name == 'all':
print(f"{student_name}'s grades:")
for class_name, grade in student_info['Grades'].items():
print(f"{class_name}: {grade}")
student_found = True
break
elif class_name in student_info['Grades']:
print(f"{student_name}'s grade in {class_name} is: {student_info['Grades'][class_name]}")
student_found = True
break
if not student_found:
print('Student or class is not in the database.')
elif option == 'D':
sub_option = input('Select an option (1: Highest grade in a class, 2: Highest average grade): ')
if sub_option == '1':
class_name = input('Enter Class Name: ')
max_grade = -1 # Initialize to a value lower than any possible grade
top_student = None
for student in students:
student_info = student.get_information()
if class_name in student_info['Grades']:
grade = student_info['Grades'][class_name]
if grade > max_grade:
max_grade = grade
top_student = student.get_name()
if top_student:
print(f'The highest grade in {class_name} is {max_grade}, earned by {top_student}.')
else:
print(f'No student in the database has a grade in {class_name}.')
elif sub_option == '2':
max_average = -1
top_student = None
for student in students:
student_info = student.get_information()
grades = student_info['Grades']
if grades:
average_grade = sum(grades.values()) / len(grades)
if average_grade > max_average:
max_average = average_grade
top_student = student.get_name()
if top_student:
print(f'The student with the highest average grade is {top_student} with an average of {max_average}.')
else:
print('No student in the database has any grades.')
else:
print('Invalid sub-option. Please select 1 or 2.')
elif option == 'E':
sub_option = input('Select an option (1: Students passing all classes, 2: Students passing a specific class): ')
if sub_option == '1':
passgrade = 70 # Default passing grade
change = input('The default passing score is 70%. Would you like to change it? [y/n]: ')
if change == 'y':
passIsValid = False
while not passIsValid:
newpass = input('Enter passing grade (integer, number only): ')
passgrade = int(newpass)
passIsValid = True
passing_students = {}
failing_students = {}
for student in students:
student_info = student.get_information()
grades = student_info['Grades']
failed = False
for grade in grades.values():
if grade < passgrade:
failed = True
break
if failed:
failing_students[student_info['Name']] = grades
else:
passing_students[student_info['Name']] = grades
if passing_students:
print('Students passing all classes:')
for student_name, student_grades in passing_students.items():
print(f'{student_name}: Grades: {student_grades}')
if failing_students:
print('Students failing some or all classes:')
for student_name, student_grades in failing_students.items():
print(f'{student_name}: Grades: {student_grades}')
elif sub_option == '2':
class_name = input('Enter Class Name: ')
passgrade = 70 # Default passing grade
change = input('The default passing score is 70%. Would you like to change it? [y/n]: ')
if change == 'y':
passIsValid = False
while not passIsValid:
newpass = input('Enter passing grade (integer, number only): ')
passgrade = int(newpass)
passIsValid = True
passing_students = {}
failing_students = {}
for student in students:
student_info = student.get_information()
grades = student_info['Grades']
if class_name in grades and grades[class_name] >= passgrade:
passing_students[student_info['Name']] = grades[class_name]
else:
failing_students[student_info['Name']] = grades.get(class_name, 0)
if passing_students:
print(f'Students passing {class_name}:')
for student_name, grade in passing_students.items():
print(f'{student_name}: Grade: {grade}')
else:
print(f'No student is passing {class_name}.')
if failing_students:
print(f'Students failing {class_name} or not in the class:')
for student_name, grade in failing_students.items():
if grade != 0:
print(f'{student_name}: Grade: {grade}')
else:
print(f'{student_name} is not in {class_name}')
else:
print(f'All students are passing {class_name}.')
else:
print('Invalid sub-option. Please select 1 or 2.')
elif option == 'F':
student_name = input('Enter Student Name: ')
student_found = False
for student in students:
if student.get_name() == student_name:
student_info = student.get_information()
print(f"{student_name}'s email is {student_info['Email']}")
student_found = True
break
if not student_found:
print('Student is not in the database.')
finishedyet = input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: ')
if finishedyet == '1':
finished = True
print('-------------------------------------------------------------')
print('Thank you for using Student Database!')
Welcome to Student Database!
A: Add Student(s)
B: Update Student Grades
C: Get Student Grade
D: Get Highest Grade
E: Get Passing Students
F: Get Student Email
New Student List:
{'Name': 'Nandan', 'Email': 'gmail', 'Grades': {'CSP': 95}}
(lambda _Y: (lambda Grade: (lambda Student: (lambda students: [print('Welcome to Student Database!'), (lambda finished: (lambda add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread: (lambda _loop1: _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread))(_Y(lambda _loop1: (lambda add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread: ([print('A: Add Student(s)\nB: Update Student Grades\nC: Get Student Grade\nD: Get Highest Grade\nE: Get Passing Students\nF: Get Student Email'), (lambda usercannotread: (lambda option, usercannotread: (lambda _loop22: _loop22(option, usercannotread))(_Y(lambda _loop22: (lambda option, usercannotread: ((lambda option: ([print(('ERROR, there is no option ' + option)), _loop22(option, usercannotread)][-1] if (option not in ['A', 'B', 'C', 'D', 'E', 'F']) else (lambda usercannotread: _loop22(option, usercannotread))(False)))(input('What would you like to do?: '))) if usercannotread else ((lambda add_more_students: (lambda add_more_students, class_name, done, grade, gradeIsValid, student, student_email, student_grades, student_name: (lambda _loop3: _loop3(add_more_students, class_name, done, grade, gradeIsValid, student, student_email, student_grades, student_name))(_Y(lambda _loop3: (lambda add_more_students, class_name, done, grade, gradeIsValid, student, student_email, student_grades, student_name: ((lambda student_name: (lambda student_email: (lambda student_grades: (lambda done: (lambda class_name, done, grade, gradeIsValid: (lambda _loop4: _loop4(class_name, done, grade, gradeIsValid))(_Y(lambda _loop4: (lambda class_name, done, grade, gradeIsValid: ((lambda class_name: ((lambda done: _loop4(class_name, done, grade, gradeIsValid))(True) if (class_name.lower() == 'done') else (lambda gradeIsValid: (lambda grade, gradeIsValid: (lambda _loop5: _loop5(grade, gradeIsValid))(_Y(lambda _loop5: (lambda grade, gradeIsValid: ((lambda grade: (lambda grade: (lambda gradeIsValid: _loop5(grade, gradeIsValid))(True))(int(grade)))(input(f'Enter Grade for {class_name}: '))) if not gradeIsValid else [_loop4(class_name, done, grade, gradeIsValid) for student_grades[class_name] in [grade]][0]))))(grade if "grade" in dir() else None, gradeIsValid if "gradeIsValid" in dir() else None))(False)))(input('Enter Class Name (or type "done" to finish adding grades for this student): '))) if not done else (lambda student: [students.append(student), (lambda add_more_students: _loop3(add_more_students, class_name, done, grade, gradeIsValid, student, student_email, student_grades, student_name))(input('Do you want to add another student? (yes/no): '))][-1])(Student(student_email, student_name, student_grades))))))(class_name if "class_name" in dir() else None, done if "done" in dir() else None, grade if "grade" in dir() else None, gradeIsValid if "gradeIsValid" in dir() else None))(False))({}))(input('Enter Student Email: ')))(input('Enter Student Name: '))) if (add_more_students.lower() == 'yes') else [print('New Student List: '), (lambda _term2, _items2: (lambda _targ2: (lambda _targ2, student: (lambda _loop2: _loop2(_targ2, student))(_Y(lambda _loop2: (lambda _targ2, student: ((lambda student: [print(student.get_information()), (lambda _targ2: _loop2(_targ2, student))(next(_items2, _term2))][-1])(_targ2)) if (_targ2 is not _term2) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ2 if "_targ2" in dir() else None, student if "student" in dir() else None))(next(_items2, _term2)))([], iter(students))][-1]))))(add_more_students if "add_more_students" in dir() else None, class_name if "class_name" in dir() else None, done if "done" in dir() else None, grade if "grade" in dir() else None, gradeIsValid if "gradeIsValid" in dir() else None, student if "student" in dir() else None, student_email if "student_email" in dir() else None, student_grades if "student_grades" in dir() else None, student_name if "student_name" in dir() else None))('yes') if (option == 'A') else ((lambda student_name: (lambda student_found: (lambda _term7, _items7: (lambda _targ7: (lambda _targ7, class_name, new_grade, student, student_found: (lambda _loop7: _loop7(_targ7, class_name, new_grade, student, student_found))(_Y(lambda _loop7: (lambda _targ7, class_name, new_grade, student, student_found: ((lambda student: ((lambda student_found: (lambda class_name: ((lambda new_grade: (lambda new_grade: [student.set_grade(class_name, new_grade), [print(f'Updated grade for {student_name} in class {class_name}'), ([print('Student is not in the database.'), [print('New Student List: '), (lambda _term6, _items6: (lambda _targ6: (lambda _targ6, student: (lambda _loop6: _loop6(_targ6, student))(_Y(lambda _loop6: (lambda _targ6, student: ((lambda student: [print(student.get_information()), (lambda _targ6: _loop6(_targ6, student))(next(_items6, _term6))][-1])(_targ6)) if (_targ6 is not _term6) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ6 if "_targ6" in dir() else None, student if "student" in dir() else None))(next(_items6, _term6)))([], iter(students))][-1]][-1] if not student_found else [print('New Student List: '), (lambda _term6, _items6: (lambda _targ6: (lambda _targ6, student: (lambda _loop6: _loop6(_targ6, student))(_Y(lambda _loop6: (lambda _targ6, student: ((lambda student: [print(student.get_information()), (lambda _targ6: _loop6(_targ6, student))(next(_items6, _term6))][-1])(_targ6)) if (_targ6 is not _term6) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ6 if "_targ6" in dir() else None, student if "student" in dir() else None))(next(_items6, _term6)))([], iter(students))][-1])][-1]][-1])(int(new_grade)))(input(f'Enter new Grade for {class_name}: ')) if (class_name in student.get_information()['Grades']) else [print(f'Class {class_name} does not exist for {student_name}'), ([print('Student is not in the database.'), [print('New Student List: '), (lambda _term6, _items6: (lambda _targ6: (lambda _targ6, student: (lambda _loop6: _loop6(_targ6, student))(_Y(lambda _loop6: (lambda _targ6, student: ((lambda student: [print(student.get_information()), (lambda _targ6: _loop6(_targ6, student))(next(_items6, _term6))][-1])(_targ6)) if (_targ6 is not _term6) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ6 if "_targ6" in dir() else None, student if "student" in dir() else None))(next(_items6, _term6)))([], iter(students))][-1]][-1] if not student_found else [print('New Student List: '), (lambda _term6, _items6: (lambda _targ6: (lambda _targ6, student: (lambda _loop6: _loop6(_targ6, student))(_Y(lambda _loop6: (lambda _targ6, student: ((lambda student: [print(student.get_information()), (lambda _targ6: _loop6(_targ6, student))(next(_items6, _term6))][-1])(_targ6)) if (_targ6 is not _term6) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ6 if "_targ6" in dir() else None, student if "student" in dir() else None))(next(_items6, _term6)))([], iter(students))][-1])][-1]))(input('Enter Class Name to update grade: ')))(True) if (student.get_name() == student_name) else (lambda _targ7: _loop7(_targ7, class_name, new_grade, student, student_found))(next(_items7, _term7))))(_targ7)) if (_targ7 is not _term7) else ([print('Student is not in the database.'), [print('New Student List: '), (lambda _term6, _items6: (lambda _targ6: (lambda _targ6, student: (lambda _loop6: _loop6(_targ6, student))(_Y(lambda _loop6: (lambda _targ6, student: ((lambda student: [print(student.get_information()), (lambda _targ6: _loop6(_targ6, student))(next(_items6, _term6))][-1])(_targ6)) if (_targ6 is not _term6) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ6 if "_targ6" in dir() else None, student if "student" in dir() else None))(next(_items6, _term6)))([], iter(students))][-1]][-1] if not student_found else [print('New Student List: '), (lambda _term6, _items6: (lambda _targ6: (lambda _targ6, student: (lambda _loop6: _loop6(_targ6, student))(_Y(lambda _loop6: (lambda _targ6, student: ((lambda student: [print(student.get_information()), (lambda _targ6: _loop6(_targ6, student))(next(_items6, _term6))][-1])(_targ6)) if (_targ6 is not _term6) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ6 if "_targ6" in dir() else None, student if "student" in dir() else None))(next(_items6, _term6)))([], iter(students))][-1])))))(_targ7 if "_targ7" in dir() else None, class_name if "class_name" in dir() else None, new_grade if "new_grade" in dir() else None, student if "student" in dir() else None, student_found if "student_found" in dir() else None))(next(_items7, _term7)))([], iter(students)))(False))(input('Enter Student Name: ')) if (option == 'B') else ((lambda student_name: (lambda class_name: (lambda student_found: (lambda _term8, _items8: (lambda _targ8: (lambda _targ8, student, student_found, student_info: (lambda _loop8: _loop8(_targ8, student, student_found, student_info))(_Y(lambda _loop8: (lambda _targ8, student, student_found, student_info: ((lambda student: ((lambda student_info: ([print(f"{student_name}'s grades:"), (lambda _term9, _items9: (lambda _targ9: (lambda _targ9, class_name, grade: (lambda _loop9: _loop9(_targ9, class_name, grade))(_Y(lambda _loop9: (lambda _targ9, class_name, grade: ([[print(f'{class_name}: {grade}'), (lambda _targ9: _loop9(_targ9, class_name, grade))(next(_items9, _term9))][-1] for (class_name, grade) in [_targ9]][0]) if (_targ9 is not _term9) else (lambda student_found: ([print('Student or class is not in the database.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1] if not student_found else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))(True)))))(_targ9 if "_targ9" in dir() else None, class_name if "class_name" in dir() else None, grade if "grade" in dir() else None))(next(_items9, _term9)))([], iter(student_info['Grades'].items()))][-1] if (class_name == 'all') else ([print(f"{student_name}'s grade in {class_name} is: {student_info['Grades'][class_name]}"), (lambda student_found: ([print('Student or class is not in the database.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1] if not student_found else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))(True)][-1] if (class_name in student_info['Grades']) else (lambda _targ8: _loop8(_targ8, student, student_found, student_info))(next(_items8, _term8)))))(student.get_information()) if (student.get_name() == student_name) else (lambda _targ8: _loop8(_targ8, student, student_found, student_info))(next(_items8, _term8))))(_targ8)) if (_targ8 is not _term8) else ([print('Student or class is not in the database.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1] if not student_found else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: ')))))))(_targ8 if "_targ8" in dir() else None, student if "student" in dir() else None, student_found if "student_found" in dir() else None, student_info if "student_info" in dir() else None))(next(_items8, _term8)))([], iter(students)))(False))(input('Enter Class Name (or type "all" for all grades): ')))(input('Enter Student Name: ')) if (option == 'C') else ((lambda sub_option: ((lambda class_name: (lambda max_grade: (lambda top_student: (lambda _term10, _items10: (lambda _targ10: (lambda _targ10, grade, max_grade, student, student_info, top_student: (lambda _loop10: _loop10(_targ10, grade, max_grade, student, student_info, top_student))(_Y(lambda _loop10: (lambda _targ10, grade, max_grade, student, student_info, top_student: ((lambda student: (lambda student_info: ((lambda grade: ((lambda max_grade: (lambda top_student: (lambda _targ10: _loop10(_targ10, grade, max_grade, student, student_info, top_student))(next(_items10, _term10)))(student.get_name()))(grade) if (grade > max_grade) else (lambda _targ10: _loop10(_targ10, grade, max_grade, student, student_info, top_student))(next(_items10, _term10))))(student_info['Grades'][class_name]) if (class_name in student_info['Grades']) else (lambda _targ10: _loop10(_targ10, grade, max_grade, student, student_info, top_student))(next(_items10, _term10))))(student.get_information()))(_targ10)) if (_targ10 is not _term10) else ([print(f'The highest grade in {class_name} is {max_grade}, earned by {top_student}.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1] if top_student else [print(f'No student in the database has a grade in {class_name}.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1])))))(_targ10 if "_targ10" in dir() else None, grade if "grade" in dir() else None, max_grade if "max_grade" in dir() else None, student if "student" in dir() else None, student_info if "student_info" in dir() else None, top_student if "top_student" in dir() else None))(next(_items10, _term10)))([], iter(students)))(None))(-1))(input('Enter Class Name: ')) if (sub_option == '1') else ((lambda max_average: (lambda top_student: (lambda _term11, _items11: (lambda _targ11: (lambda _targ11, average_grade, grades, max_average, student, student_info, top_student: (lambda _loop11: _loop11(_targ11, average_grade, grades, max_average, student, student_info, top_student))(_Y(lambda _loop11: (lambda _targ11, average_grade, grades, max_average, student, student_info, top_student: ((lambda student: (lambda student_info: (lambda grades: ((lambda average_grade: ((lambda max_average: (lambda top_student: (lambda _targ11: _loop11(_targ11, average_grade, grades, max_average, student, student_info, top_student))(next(_items11, _term11)))(student.get_name()))(average_grade) if (average_grade > max_average) else (lambda _targ11: _loop11(_targ11, average_grade, grades, max_average, student, student_info, top_student))(next(_items11, _term11))))((sum(grades.values()) / len(grades))) if grades else (lambda _targ11: _loop11(_targ11, average_grade, grades, max_average, student, student_info, top_student))(next(_items11, _term11))))(student_info['Grades']))(student.get_information()))(_targ11)) if (_targ11 is not _term11) else ([print(f'The student with the highest average grade is {top_student} with an average of {max_average}.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1] if top_student else [print('No student in the database has any grades.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1])))))(_targ11 if "_targ11" in dir() else None, average_grade if "average_grade" in dir() else None, grades if "grades" in dir() else None, max_average if "max_average" in dir() else None, student if "student" in dir() else None, student_info if "student_info" in dir() else None, top_student if "top_student" in dir() else None))(next(_items11, _term11)))([], iter(students)))(None))(-1) if (sub_option == '2') else [print('Invalid sub-option. Please select 1 or 2.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1])))(input('Select an option (1: Highest grade in a class, 2: Highest average grade): ')) if (option == 'D') else ((lambda sub_option: ((lambda passgrade: (lambda change: ((lambda passIsValid: (lambda newpass, passIsValid, passgrade: (lambda _loop16: _loop16(newpass, passIsValid, passgrade))(_Y(lambda _loop16: (lambda newpass, passIsValid, passgrade: ((lambda newpass: (lambda passgrade: (lambda passIsValid: _loop16(newpass, passIsValid, passgrade))(True))(int(newpass)))(input('Enter passing grade (integer, number only): '))) if not passIsValid else (lambda passing_students: (lambda failing_students: (lambda _term14, _items14: (lambda _targ14: (lambda _targ14, failed, grades, student, student_info: (lambda _loop14: _loop14(_targ14, failed, grades, student, student_info))(_Y(lambda _loop14: (lambda _targ14, failed, grades, student, student_info: ((lambda student: (lambda student_info: (lambda grades: (lambda failed: (lambda _term15, _items15: (lambda _targ15: (lambda _targ15, failed, grade: (lambda _loop15: _loop15(_targ15, failed, grade))(_Y(lambda _loop15: (lambda _targ15, failed, grade: ((lambda grade: ((lambda failed: ([(lambda _targ14: _loop14(_targ14, failed, grades, student, student_info))(next(_items14, _term14)) for failing_students[student_info['Name']] in [grades]][0] if failed else [(lambda _targ14: _loop14(_targ14, failed, grades, student, student_info))(next(_items14, _term14)) for passing_students[student_info['Name']] in [grades]][0]))(True) if (grade < passgrade) else (lambda _targ15: _loop15(_targ15, failed, grade))(next(_items15, _term15))))(_targ15)) if (_targ15 is not _term15) else ([(lambda _targ14: _loop14(_targ14, failed, grades, student, student_info))(next(_items14, _term14)) for failing_students[student_info['Name']] in [grades]][0] if failed else [(lambda _targ14: _loop14(_targ14, failed, grades, student, student_info))(next(_items14, _term14)) for passing_students[student_info['Name']] in [grades]][0])))))(_targ15 if "_targ15" in dir() else None, failed if "failed" in dir() else None, grade if "grade" in dir() else None))(next(_items15, _term15)))([], iter(grades.values())))(False))(student_info['Grades']))(student.get_information()))(_targ14)) if (_targ14 is not _term14) else ([print('Students passing all classes:'), (lambda _term13, _items13: (lambda _targ13: (lambda _targ13, student_grades, student_name: (lambda _loop13: _loop13(_targ13, student_grades, student_name))(_Y(lambda _loop13: (lambda _targ13, student_grades, student_name: ([[print(f'{student_name}: Grades: {student_grades}'), (lambda _targ13: _loop13(_targ13, student_grades, student_name))(next(_items13, _term13))][-1] for (student_name, student_grades) in [_targ13]][0]) if (_targ13 is not _term13) else ([print('Students failing some or all classes:'), (lambda _term12, _items12: (lambda _targ12: (lambda _targ12, student_grades, student_name: (lambda _loop12: _loop12(_targ12, student_grades, student_name))(_Y(lambda _loop12: (lambda _targ12, student_grades, student_name: ([[print(f'{student_name}: Grades: {student_grades}'), (lambda _targ12: _loop12(_targ12, student_grades, student_name))(next(_items12, _term12))][-1] for (student_name, student_grades) in [_targ12]][0]) if (_targ12 is not _term12) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ12 if "_targ12" in dir() else None, student_grades if "student_grades" in dir() else None, student_name if "student_name" in dir() else None))(next(_items12, _term12)))([], iter(failing_students.items()))][-1] if failing_students else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: ')))))))(_targ13 if "_targ13" in dir() else None, student_grades if "student_grades" in dir() else None, student_name if "student_name" in dir() else None))(next(_items13, _term13)))([], iter(passing_students.items()))][-1] if passing_students else ([print('Students failing some or all classes:'), (lambda _term12, _items12: (lambda _targ12: (lambda _targ12, student_grades, student_name: (lambda _loop12: _loop12(_targ12, student_grades, student_name))(_Y(lambda _loop12: (lambda _targ12, student_grades, student_name: ([[print(f'{student_name}: Grades: {student_grades}'), (lambda _targ12: _loop12(_targ12, student_grades, student_name))(next(_items12, _term12))][-1] for (student_name, student_grades) in [_targ12]][0]) if (_targ12 is not _term12) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ12 if "_targ12" in dir() else None, student_grades if "student_grades" in dir() else None, student_name if "student_name" in dir() else None))(next(_items12, _term12)))([], iter(failing_students.items()))][-1] if failing_students else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))))(_targ14 if "_targ14" in dir() else None, failed if "failed" in dir() else None, grades if "grades" in dir() else None, student if "student" in dir() else None, student_info if "student_info" in dir() else None))(next(_items14, _term14)))([], iter(students)))({}))({})))))(newpass if "newpass" in dir() else None, passIsValid if "passIsValid" in dir() else None, passgrade if "passgrade" in dir() else None))(False) if (change == 'y') else (lambda passing_students: (lambda failing_students: (lambda _term14, _items14: (lambda _targ14: (lambda _targ14, failed, grades, student, student_info: (lambda _loop14: _loop14(_targ14, failed, grades, student, student_info))(_Y(lambda _loop14: (lambda _targ14, failed, grades, student, student_info: ((lambda student: (lambda student_info: (lambda grades: (lambda failed: (lambda _term15, _items15: (lambda _targ15: (lambda _targ15, failed, grade: (lambda _loop15: _loop15(_targ15, failed, grade))(_Y(lambda _loop15: (lambda _targ15, failed, grade: ((lambda grade: ((lambda failed: ([(lambda _targ14: _loop14(_targ14, failed, grades, student, student_info))(next(_items14, _term14)) for failing_students[student_info['Name']] in [grades]][0] if failed else [(lambda _targ14: _loop14(_targ14, failed, grades, student, student_info))(next(_items14, _term14)) for passing_students[student_info['Name']] in [grades]][0]))(True) if (grade < passgrade) else (lambda _targ15: _loop15(_targ15, failed, grade))(next(_items15, _term15))))(_targ15)) if (_targ15 is not _term15) else ([(lambda _targ14: _loop14(_targ14, failed, grades, student, student_info))(next(_items14, _term14)) for failing_students[student_info['Name']] in [grades]][0] if failed else [(lambda _targ14: _loop14(_targ14, failed, grades, student, student_info))(next(_items14, _term14)) for passing_students[student_info['Name']] in [grades]][0])))))(_targ15 if "_targ15" in dir() else None, failed if "failed" in dir() else None, grade if "grade" in dir() else None))(next(_items15, _term15)))([], iter(grades.values())))(False))(student_info['Grades']))(student.get_information()))(_targ14)) if (_targ14 is not _term14) else ([print('Students passing all classes:'), (lambda _term13, _items13: (lambda _targ13: (lambda _targ13, student_grades, student_name: (lambda _loop13: _loop13(_targ13, student_grades, student_name))(_Y(lambda _loop13: (lambda _targ13, student_grades, student_name: ([[print(f'{student_name}: Grades: {student_grades}'), (lambda _targ13: _loop13(_targ13, student_grades, student_name))(next(_items13, _term13))][-1] for (student_name, student_grades) in [_targ13]][0]) if (_targ13 is not _term13) else ([print('Students failing some or all classes:'), (lambda _term12, _items12: (lambda _targ12: (lambda _targ12, student_grades, student_name: (lambda _loop12: _loop12(_targ12, student_grades, student_name))(_Y(lambda _loop12: (lambda _targ12, student_grades, student_name: ([[print(f'{student_name}: Grades: {student_grades}'), (lambda _targ12: _loop12(_targ12, student_grades, student_name))(next(_items12, _term12))][-1] for (student_name, student_grades) in [_targ12]][0]) if (_targ12 is not _term12) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ12 if "_targ12" in dir() else None, student_grades if "student_grades" in dir() else None, student_name if "student_name" in dir() else None))(next(_items12, _term12)))([], iter(failing_students.items()))][-1] if failing_students else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: ')))))))(_targ13 if "_targ13" in dir() else None, student_grades if "student_grades" in dir() else None, student_name if "student_name" in dir() else None))(next(_items13, _term13)))([], iter(passing_students.items()))][-1] if passing_students else ([print('Students failing some or all classes:'), (lambda _term12, _items12: (lambda _targ12: (lambda _targ12, student_grades, student_name: (lambda _loop12: _loop12(_targ12, student_grades, student_name))(_Y(lambda _loop12: (lambda _targ12, student_grades, student_name: ([[print(f'{student_name}: Grades: {student_grades}'), (lambda _targ12: _loop12(_targ12, student_grades, student_name))(next(_items12, _term12))][-1] for (student_name, student_grades) in [_targ12]][0]) if (_targ12 is not _term12) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ12 if "_targ12" in dir() else None, student_grades if "student_grades" in dir() else None, student_name if "student_name" in dir() else None))(next(_items12, _term12)))([], iter(failing_students.items()))][-1] if failing_students else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))))(_targ14 if "_targ14" in dir() else None, failed if "failed" in dir() else None, grades if "grades" in dir() else None, student if "student" in dir() else None, student_info if "student_info" in dir() else None))(next(_items14, _term14)))([], iter(students)))({}))({})))(input('The default passing score is 70%. Would you like to change it? [y/n]: ')))(70) if (sub_option == '1') else ((lambda class_name: (lambda passgrade: (lambda change: ((lambda passIsValid: (lambda newpass, passIsValid, passgrade: (lambda _loop20: _loop20(newpass, passIsValid, passgrade))(_Y(lambda _loop20: (lambda newpass, passIsValid, passgrade: ((lambda newpass: (lambda passgrade: (lambda passIsValid: _loop20(newpass, passIsValid, passgrade))(True))(int(newpass)))(input('Enter passing grade (integer, number only): '))) if not passIsValid else (lambda passing_students: (lambda failing_students: (lambda _term19, _items19: (lambda _targ19: (lambda _targ19, grades, student, student_info: (lambda _loop19: _loop19(_targ19, grades, student, student_info))(_Y(lambda _loop19: (lambda _targ19, grades, student, student_info: ((lambda student: (lambda student_info: (lambda grades: ([(lambda _targ19: _loop19(_targ19, grades, student, student_info))(next(_items19, _term19)) for passing_students[student_info['Name']] in [grades[class_name]]][0] if (class_name in grades) and (grades[class_name] >= passgrade) else [(lambda _targ19: _loop19(_targ19, grades, student, student_info))(next(_items19, _term19)) for failing_students[student_info['Name']] in [grades.get(class_name, 0)]][0]))(student_info['Grades']))(student.get_information()))(_targ19)) if (_targ19 is not _term19) else ([print(f'Students passing {class_name}:'), (lambda _term18, _items18: (lambda _targ18: (lambda _targ18, grade, student_name: (lambda _loop18: _loop18(_targ18, grade, student_name))(_Y(lambda _loop18: (lambda _targ18, grade, student_name: ([[print(f'{student_name}: Grade: {grade}'), (lambda _targ18: _loop18(_targ18, grade, student_name))(next(_items18, _term18))][-1] for (student_name, grade) in [_targ18]][0]) if (_targ18 is not _term18) else ([print(f'Students failing {class_name} or not in the class:'), (lambda _term17, _items17: (lambda _targ17: (lambda _targ17, grade, student_name: (lambda _loop17: _loop17(_targ17, grade, student_name))(_Y(lambda _loop17: (lambda _targ17, grade, student_name: ([([print(f'{student_name}: Grade: {grade}'), (lambda _targ17: _loop17(_targ17, grade, student_name))(next(_items17, _term17))][-1] if (grade != 0) else [print(f'{student_name} is not in {class_name}'), (lambda _targ17: _loop17(_targ17, grade, student_name))(next(_items17, _term17))][-1]) for (student_name, grade) in [_targ17]][0]) if (_targ17 is not _term17) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ17 if "_targ17" in dir() else None, grade if "grade" in dir() else None, student_name if "student_name" in dir() else None))(next(_items17, _term17)))([], iter(failing_students.items()))][-1] if failing_students else [print(f'All students are passing {class_name}.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1])))))(_targ18 if "_targ18" in dir() else None, grade if "grade" in dir() else None, student_name if "student_name" in dir() else None))(next(_items18, _term18)))([], iter(passing_students.items()))][-1] if passing_students else [print(f'No student is passing {class_name}.'), ([print(f'Students failing {class_name} or not in the class:'), (lambda _term17, _items17: (lambda _targ17: (lambda _targ17, grade, student_name: (lambda _loop17: _loop17(_targ17, grade, student_name))(_Y(lambda _loop17: (lambda _targ17, grade, student_name: ([([print(f'{student_name}: Grade: {grade}'), (lambda _targ17: _loop17(_targ17, grade, student_name))(next(_items17, _term17))][-1] if (grade != 0) else [print(f'{student_name} is not in {class_name}'), (lambda _targ17: _loop17(_targ17, grade, student_name))(next(_items17, _term17))][-1]) for (student_name, grade) in [_targ17]][0]) if (_targ17 is not _term17) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ17 if "_targ17" in dir() else None, grade if "grade" in dir() else None, student_name if "student_name" in dir() else None))(next(_items17, _term17)))([], iter(failing_students.items()))][-1] if failing_students else [print(f'All students are passing {class_name}.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1])][-1])))))(_targ19 if "_targ19" in dir() else None, grades if "grades" in dir() else None, student if "student" in dir() else None, student_info if "student_info" in dir() else None))(next(_items19, _term19)))([], iter(students)))({}))({})))))(newpass if "newpass" in dir() else None, passIsValid if "passIsValid" in dir() else None, passgrade if "passgrade" in dir() else None))(False) if (change == 'y') else (lambda passing_students: (lambda failing_students: (lambda _term19, _items19: (lambda _targ19: (lambda _targ19, grades, student, student_info: (lambda _loop19: _loop19(_targ19, grades, student, student_info))(_Y(lambda _loop19: (lambda _targ19, grades, student, student_info: ((lambda student: (lambda student_info: (lambda grades: ([(lambda _targ19: _loop19(_targ19, grades, student, student_info))(next(_items19, _term19)) for passing_students[student_info['Name']] in [grades[class_name]]][0] if (class_name in grades) and (grades[class_name] >= passgrade) else [(lambda _targ19: _loop19(_targ19, grades, student, student_info))(next(_items19, _term19)) for failing_students[student_info['Name']] in [grades.get(class_name, 0)]][0]))(student_info['Grades']))(student.get_information()))(_targ19)) if (_targ19 is not _term19) else ([print(f'Students passing {class_name}:'), (lambda _term18, _items18: (lambda _targ18: (lambda _targ18, grade, student_name: (lambda _loop18: _loop18(_targ18, grade, student_name))(_Y(lambda _loop18: (lambda _targ18, grade, student_name: ([[print(f'{student_name}: Grade: {grade}'), (lambda _targ18: _loop18(_targ18, grade, student_name))(next(_items18, _term18))][-1] for (student_name, grade) in [_targ18]][0]) if (_targ18 is not _term18) else ([print(f'Students failing {class_name} or not in the class:'), (lambda _term17, _items17: (lambda _targ17: (lambda _targ17, grade, student_name: (lambda _loop17: _loop17(_targ17, grade, student_name))(_Y(lambda _loop17: (lambda _targ17, grade, student_name: ([([print(f'{student_name}: Grade: {grade}'), (lambda _targ17: _loop17(_targ17, grade, student_name))(next(_items17, _term17))][-1] if (grade != 0) else [print(f'{student_name} is not in {class_name}'), (lambda _targ17: _loop17(_targ17, grade, student_name))(next(_items17, _term17))][-1]) for (student_name, grade) in [_targ17]][0]) if (_targ17 is not _term17) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ17 if "_targ17" in dir() else None, grade if "grade" in dir() else None, student_name if "student_name" in dir() else None))(next(_items17, _term17)))([], iter(failing_students.items()))][-1] if failing_students else [print(f'All students are passing {class_name}.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1])))))(_targ18 if "_targ18" in dir() else None, grade if "grade" in dir() else None, student_name if "student_name" in dir() else None))(next(_items18, _term18)))([], iter(passing_students.items()))][-1] if passing_students else [print(f'No student is passing {class_name}.'), ([print(f'Students failing {class_name} or not in the class:'), (lambda _term17, _items17: (lambda _targ17: (lambda _targ17, grade, student_name: (lambda _loop17: _loop17(_targ17, grade, student_name))(_Y(lambda _loop17: (lambda _targ17, grade, student_name: ([([print(f'{student_name}: Grade: {grade}'), (lambda _targ17: _loop17(_targ17, grade, student_name))(next(_items17, _term17))][-1] if (grade != 0) else [print(f'{student_name} is not in {class_name}'), (lambda _targ17: _loop17(_targ17, grade, student_name))(next(_items17, _term17))][-1]) for (student_name, grade) in [_targ17]][0]) if (_targ17 is not _term17) else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))(_targ17 if "_targ17" in dir() else None, grade if "grade" in dir() else None, student_name if "student_name" in dir() else None))(next(_items17, _term17)))([], iter(failing_students.items()))][-1] if failing_students else [print(f'All students are passing {class_name}.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1])][-1])))))(_targ19 if "_targ19" in dir() else None, grades if "grades" in dir() else None, student if "student" in dir() else None, student_info if "student_info" in dir() else None))(next(_items19, _term19)))([], iter(students)))({}))({})))(input('The default passing score is 70%. Would you like to change it? [y/n]: ')))(70))(input('Enter Class Name: ')) if (sub_option == '2') else [print('Invalid sub-option. Please select 1 or 2.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1])))(input('Select an option (1: Students passing all classes, 2: Students passing a specific class): ')) if (option == 'E') else ((lambda student_name: (lambda student_found: (lambda _term21, _items21: (lambda _targ21: (lambda _targ21, student, student_found, student_info: (lambda _loop21: _loop21(_targ21, student, student_found, student_info))(_Y(lambda _loop21: (lambda _targ21, student, student_found, student_info: ((lambda student: ((lambda student_info: [print(f"{student_name}'s email is {student_info['Email']}"), (lambda student_found: ([print('Student is not in the database.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1] if not student_found else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))(True)][-1])(student.get_information()) if (student.get_name() == student_name) else (lambda _targ21: _loop21(_targ21, student, student_found, student_info))(next(_items21, _term21))))(_targ21)) if (_targ21 is not _term21) else ([print('Student is not in the database.'), (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))][-1] if not student_found else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: ')))))))(_targ21 if "_targ21" in dir() else None, student if "student" in dir() else None, student_found if "student_found" in dir() else None, student_info if "student_info" in dir() else None))(next(_items21, _term21)))([], iter(students)))(False))(input('Enter Student Name: ')) if (option == 'F') else (lambda finishedyet: ((lambda finished: [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1])(True) if (finishedyet == '1') else [print('-------------------------------------------------------------'), _loop1(add_more_students, average_grade, change, class_name, done, failed, failing_students, finished, finishedyet, grade, gradeIsValid, grades, max_average, max_grade, new_grade, newpass, option, passIsValid, passgrade, passing_students, student, student_email, student_found, student_grades, student_info, student_name, sub_option, top_student, usercannotread)][-1]))(input('Do you want to exit or keep working? [1 - exit, 2 - keep working]: '))))))))))))(option if "option" in dir() else None, usercannotread if "usercannotread" in dir() else None))(True)][-1]) if not finished else print('Thank you for using Student Database!')))))(add_more_students if "add_more_students" in dir() else None, average_grade if "average_grade" in dir() else None, change if "change" in dir() else None, class_name if "class_name" in dir() else None, done if "done" in dir() else None, failed if "failed" in dir() else None, failing_students if "failing_students" in dir() else None, finished if "finished" in dir() else None, finishedyet if "finishedyet" in dir() else None, grade if "grade" in dir() else None, gradeIsValid if "gradeIsValid" in dir() else None, grades if "grades" in dir() else None, max_average if "max_average" in dir() else None, max_grade if "max_grade" in dir() else None, new_grade if "new_grade" in dir() else None, newpass if "newpass" in dir() else None, option if "option" in dir() else None, passIsValid if "passIsValid" in dir() else None, passgrade if "passgrade" in dir() else None, passing_students if "passing_students" in dir() else None, student if "student" in dir() else None, student_email if "student_email" in dir() else None, student_found if "student_found" in dir() else None, student_grades if "student_grades" in dir() else None, student_info if "student_info" in dir() else None, student_name if "student_name" in dir() else None, sub_option if "sub_option" in dir() else None, top_student if "top_student" in dir() else None, usercannotread if "usercannotread" in dir() else None))(False)][-1])([]))(type("Student", (), {'__init__': lambda self, email, name, grade_dict: [[[[(lambda _term23, _items23: (lambda _targ23: (lambda _targ23, class_name: (lambda _loop23: _loop23(_targ23, class_name))(_Y(lambda _loop23: (lambda _targ23, class_name: ((lambda class_name: [self.grade_list.append(Grade(class_name, grade_dict[class_name])), (lambda _targ23: _loop23(_targ23, class_name))(next(_items23, _term23))][-1])(_targ23)) if (_targ23 is not _term23) else None))))(_targ23 if "_targ23" in dir() else None, class_name if "class_name" in dir() else None))(next(_items23, _term23)))([], iter(grade_dict)) for self.name in [name]][0] for self.email in [email]][0] for self.grade_list in [[]]][0], None][-1], 'add_grade': lambda self, classname, grade: self.grade_list.append(Grade(classname, grade)), 'get_grade': lambda self, index: (self.grade_list[index] if (0 <= index < len(self.grade_list)) else None), 'set_grade': lambda self, classname, new_grade: (lambda grade_found: (lambda _term24, _items24: (lambda _targ24: (lambda _targ24, grade, grade_found: (lambda _loop24: _loop24(_targ24, grade, grade_found))(_Y(lambda _loop24: (lambda _targ24, grade, grade_found: ((lambda grade: ([grade.change_grade(new_grade), (lambda grade_found: (print('Error: Class name not found') if not grade_found else None))(True)][-1] if (classname == grade.get_name()) else (lambda _targ24: _loop24(_targ24, grade, grade_found))(next(_items24, _term24))))(_targ24)) if (_targ24 is not _term24) else (print('Error: Class name not found') if not grade_found else None)))))(_targ24 if "_targ24" in dir() else None, grade if "grade" in dir() else None, grade_found if "grade_found" in dir() else None))(next(_items24, _term24)))([], iter(self.grade_list)))(False), 'get_email': lambda self: self.email, 'get_name': lambda self: self.name, 'set_name': lambda self, new_name: [None for self.name in [new_name]][0], 'set_email': lambda self, new_email: [None for self.email in [new_email]][0], 'get_information': lambda self: (lambda info: [[(lambda gradedict: (lambda _term25, _items25: (lambda _targ25: (lambda _targ25, grade: (lambda _loop25: _loop25(_targ25, grade))(_Y(lambda _loop25: (lambda _targ25, grade: ((lambda grade: [(lambda _targ25: _loop25(_targ25, grade))(next(_items25, _term25)) for gradedict[grade.get_name()] in [grade.get_grade()]][0])(_targ25)) if (_targ25 is not _term25) else [info for info['Grades'] in [gradedict]][0]))))(_targ25 if "_targ25" in dir() else None, grade if "grade" in dir() else None))(next(_items25, _term25)))([], iter(self.grade_list)))({}) for info['Email'] in [self.email]][0] for info['Name'] in [self.name]][0])({})})))(type("Grade", (), {'__init__': lambda self, classname, grade: [[[None for self.grade in [grade]][0] for self.classname in [classname]][0], None][-1], 'get_name': lambda self: self.classname, 'get_grade': lambda self: self.grade, 'change_name': lambda self, newname: [None for self.classname in [newname]][0], 'change_grade': lambda self, newgrade: [None for self.grade in [newgrade]][0]})))((lambda f: (lambda x: x(x))(lambda y: f(lambda *args: y(y)(*args)))))
Welcome to Student Database!
A: Add Student(s)
B: Update Student Grades
C: Get Student Grade
D: Get Highest Grade
E: Get Passing Students
F: Get Student Email
New Student List:
{'Name': 'John', 'Email': 'john@john.com', 'Grades': {'math': 90, 'science': 58, 'english': 67}}
{'Name': 'toby', 'Email': 'toby@toby.com', 'Grades': {'math': 87, 'science': 92, 'english': 73}}
{'Name': 'mary', 'Email': 'mary@mary.com', 'Grades': {'math': 68, 'science': 76, 'english': 93}}
-------------------------------------------------------------
A: Add Student(s)
B: Update Student Grades
C: Get Student Grade
D: Get Highest Grade
E: Get Passing Students
F: Get Student Email
Updated grade for toby in class math
New Student List:
{'Name': 'John', 'Email': 'john@john.com', 'Grades': {'math': 90, 'science': 58, 'english': 67}}
{'Name': 'toby', 'Email': 'toby@toby.com', 'Grades': {'math': 84, 'science': 92, 'english': 73}}
{'Name': 'mary', 'Email': 'mary@mary.com', 'Grades': {'math': 68, 'science': 76, 'english': 93}}
-------------------------------------------------------------
A: Add Student(s)
B: Update Student Grades
C: Get Student Grade
D: Get Highest Grade
E: Get Passing Students
F: Get Student Email
mary's grades:
math: 68
science: 76
english: 93
-------------------------------------------------------------
A: Add Student(s)
B: Update Student Grades
C: Get Student Grade
D: Get Highest Grade
E: Get Passing Students
F: Get Student Email
The highest grade in science is 92, earned by toby.
-------------------------------------------------------------
A: Add Student(s)
B: Update Student Grades
C: Get Student Grade
D: Get Highest Grade
E: Get Passing Students
F: Get Student Email
The student with the highest average grade is toby with an average of 83.0.
-------------------------------------------------------------
A: Add Student(s)
B: Update Student Grades
C: Get Student Grade
D: Get Highest Grade
E: Get Passing Students
F: Get Student Email
Students passing science:
toby: Grade: 92
mary: Grade: 76
Students failing science or not in the class:
John: Grade: 58
-------------------------------------------------------------
A: Add Student(s)
B: Update Student Grades
C: Get Student Grade
D: Get Highest Grade
E: Get Passing Students
F: Get Student Email
Students passing math:
John: Grade: 90
Students failing math or not in the class:
toby: Grade: 84
mary: Grade: 68
-------------------------------------------------------------
A: Add Student(s)
B: Update Student Grades
C: Get Student Grade
D: Get Highest Grade
E: Get Passing Students
F: Get Student Email
Students passing all classes:
toby: Grades: {'math': 84, 'science': 92, 'english': 73}
Students failing some or all classes:
John: Grades: {'math': 90, 'science': 58, 'english': 67}
mary: Grades: {'math': 68, 'science': 76, 'english': 93}
-------------------------------------------------------------
A: Add Student(s)
B: Update Student Grades
C: Get Student Grade
D: Get Highest Grade
E: Get Passing Students
F: Get Student Email
Students passing all classes:
toby: Grades: {'math': 84, 'science': 92, 'english': 73}
Students failing some or all classes:
John: Grades: {'math': 90, 'science': 58, 'english': 67}
mary: Grades: {'math': 68, 'science': 76, 'english': 93}
-------------------------------------------------------------
A: Add Student(s)
B: Update Student Grades
C: Get Student Grade
D: Get Highest Grade
E: Get Passing Students
F: Get Student Email
Students passing all classes:
toby: Grades: {'math': 84, 'science': 92, 'english': 73}
mary: Grades: {'math': 68, 'science': 76, 'english': 93}
Students failing some or all classes:
John: Grades: {'math': 90, 'science': 58, 'english': 67}
-------------------------------------------------------------
A: Add Student(s)
B: Update Student Grades
C: Get Student Grade
D: Get Highest Grade
E: Get Passing Students
F: Get Student Email
mary's email is mary@mary.com
-------------------------------------------------------------
A: Add Student(s)
B: Update Student Grades
C: Get Student Grade
D: Get Highest Grade
E: Get Passing Students
F: Get Student Email
Student is not in the database.
-------------------------------------------------------------
Thank you for using Student Database!