
Get in Touch

import tkinter as tk from tkinter import messagebox def check_code(): """Checks the entered code and displays a winning message if correct.""" entered_code = code_entry.get() winning_code = "12345" # Replace with your actual winning code if entered_code == winning_code: messagebox.showinfo("Congratulations!", "You've won $750,000!") else: messagebox.showinfo("Sorry", "Incorrect code. Please try again.") # Create the main window window = tk.Tk() window.title("Check for Winner") # Create and place the label label = tk.Label(window, text="Enter Code:") label.pack(pady=10) # Create and place the entry field code_entry = tk.Entry(window) code_entry.pack(pady=5) # Create and place the button check_button = tk.Button(window, text="Check if you are a winner", command=check_code) check_button.pack(pady=10) # Start the GUI event loop window.mainloop()
Check if you are a winner!