Skip to content

Commit 430ee2e

Browse files
committed
added docstring
1 parent ddd4bfa commit 430ee2e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sgpa_To_Cgpa_Convertor/sga_to_cgpa.py

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

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

@@ -18,16 +18,16 @@ def create_sgpa_entries():
1818
create_sgpa_buttons.grid_remove()
1919
cgpa_calc.grid(row=num_semesters + 2, column=0, columnspan=2, padx=10, pady=5)
2020

21-
21+
"""Validate the SGPA entries to enable or disable the CGPA calculation button."""
2222
def validate_sgpa_entries():
2323
filled_entries = [entry.get() for entry in sgpa_entries]
2424
if all(filled_entries):
2525
cgpa_calc.configure(state="normal")
2626
else:
2727
cgpa_calc.configure(state="disabled")
2828

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

3333
total_sgpa = sum(sgpa_values)
@@ -38,7 +38,7 @@ def calculate_cgpa():
3838

3939
reset_button.configure(state="normal")
4040

41-
41+
"""This is used to reset entries after calcuting Cgpa."""
4242
def reset_entries():
4343
for label in sgpa_labels:
4444
label.destroy()

0 commit comments

Comments
 (0)