Skip to content

Commit bd1aa28

Browse files
committed
improved docstring
1 parent 430ee2e commit bd1aa28

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Sgpa_To_Cgpa_Convertor/sga_to_cgpa.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import tkinter as tk
22

3-
"""Create SGPA entries based on the total number of semesters entered by the user."""
4-
def create_sgpa_entries():
3+
def create_sgpa_entries(): # Create SGPA entries based on the total number of semesters entered by the user.
54
num_semesters = int(num_semesters_entry.get())
65

76
for i in range(num_semesters):
@@ -18,16 +17,15 @@ def create_sgpa_entries():
1817
create_sgpa_buttons.grid_remove()
1918
cgpa_calc.grid(row=num_semesters + 2, column=0, columnspan=2, padx=10, pady=5)
2019

21-
"""Validate the SGPA entries to enable or disable the CGPA calculation button."""
22-
def validate_sgpa_entries():
20+
21+
def validate_sgpa_entries(): # Validate the SGPA entries to enable or disable the CGPA calculation button.
2322
filled_entries = [entry.get() for entry in sgpa_entries]
2423
if all(filled_entries):
2524
cgpa_calc.configure(state="normal")
2625
else:
2726
cgpa_calc.configure(state="disabled")
2827

29-
"""It is used to calculate cgpa."""
30-
def calculate_cgpa():
28+
def calculate_cgpa(): # It is used to calculate cgpa.
3129
sgpa_values = [float(sgpa_entry.get()) for sgpa_entry in sgpa_entries]
3230

3331
total_sgpa = sum(sgpa_values)
@@ -38,8 +36,7 @@ def calculate_cgpa():
3836

3937
reset_button.configure(state="normal")
4038

41-
"""This is used to reset entries after calcuting Cgpa."""
42-
def reset_entries():
39+
def reset_entries(): # This is used to reset entries after calcuting Cgpa.
4340
for label in sgpa_labels:
4441
label.destroy()
4542
for entry in sgpa_entries:

0 commit comments

Comments
 (0)