fixed certain functions, simplified the code and added descrption for certain lines of code. [perfect code]

This commit is contained in:
K 2023-12-07 16:19:16 +05:30
parent 5e97a900f4
commit 9820343428
Signed by: notkshitij
GPG Key ID: C5B8BC7530F8F43F

View File

@ -28,14 +28,14 @@ def average_marks():
if (i >= 0):
marks_withoutAbsent.append(i)
else:
break
continue
average_calc = sum(marks_withoutAbsent) / total
print(f"\n------\nAverage score of {total} students is:\t{average_calc}\n-----")
# Option 2 = High and low marks
def high_low():
maxi = marks[0] # Initialize maxi with the first element of the marks list
mini = marks[0] # Initialize mini with the first element of the marks list
maxi = marks[0] # Initialise maxi with the first element of the marks list
mini = marks[0] # Initialise mini with the first element of the marks list
for i in range(len(marks)):
if (maxi < marks[i] and marks[i] > -1):
maxi = marks[i]