Skip to content

Commit 6a24759

Browse files
committed
Update convert.py
1 parent b799227 commit 6a24759

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

convert.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,18 @@ def convert():
1818
result_label.config(text=f"Result: {result:.2f} {to_unit}")
1919
except ValueError:
2020
result_label.config(text="Invalid input! Please enter a number.")
21-
22-
# Create the main window
21+
2322
app = tk.Tk()
2423
app.title("Unit Converter")
2524
app.geometry("300x250")
2625

27-
# Input field
26+
2827
entry_label = tk.Label(app, text="Enter value:")
2928
entry_label.pack(pady=5)
3029
entry = tk.Entry(app, width=20)
3130
entry.pack(pady=5)
3231

33-
# From unit combobox
32+
3433
from_label = tk.Label(app, text="From:")
3534
from_label.pack(pady=5)
3635
from_combobox = ttk.Combobox(app, values=["Kilometers", "Meters", "Centimeters", "Millimeters"])

0 commit comments

Comments
 (0)