1
1
import tkinter as tk
2
2
3
+
3
4
def create_sgpa_entries (): # Create SGPA entries based on the total number of semesters entered by the user.
4
5
num_semesters = int (num_semesters_entry .get ())
5
6
@@ -18,13 +19,14 @@ def create_sgpa_entries(): # Create SGPA entries based on the total number of s
18
19
cgpa_calc .grid (row = num_semesters + 2 , column = 0 , columnspan = 2 , padx = 10 , pady = 5 )
19
20
20
21
21
- def validate_sgpa_entries (): # Validate the SGPA entries to enable or disable the CGPA calculation button.
22
+ def validate_sgpa_entries (): # Validate the SGPA entries to enable or disable the CGPA calculation button.
22
23
filled_entries = [entry .get () for entry in sgpa_entries ]
23
24
if all (filled_entries ):
24
25
cgpa_calc .configure (state = "normal" )
25
26
else :
26
27
cgpa_calc .configure (state = "disabled" )
27
28
29
+
28
30
def calculate_cgpa (): # It is used to calculate cgpa.
29
31
sgpa_values = [float (sgpa_entry .get ()) for sgpa_entry in sgpa_entries ]
30
32
@@ -36,7 +38,8 @@ def calculate_cgpa(): # It is used to calculate cgpa.
36
38
37
39
reset_button .configure (state = "normal" )
38
40
39
- def reset_entries (): # This is used to reset entries after calcuting Cgpa.
41
+
42
+ def reset_entries (): # This is used to reset entries after calcuting Cgpa.
40
43
for label in sgpa_labels :
41
44
label .destroy ()
42
45
for entry in sgpa_entries :
0 commit comments