'I wrote a simple chatterbot using tkinter in python, I'm wondering how I could do to improve it to make it easier to use and general make it better a?

I'm wrote a basic chatterbot and wondering what you would do to pretty much improve it and make it better then this? Because I want this chatterbot to be the best it could be and I really want other people's opinion of how they would improve it. Here is the code:

import tkinter as tk  

# --- functions ---

def cmd3():
    # default value at start
    x = None
    y = None
    
    # remove previous text
    label1['text'] = ""
    label2['text'] = ""
    
    text = text1.get()
    
    if text == "":
        label1['text'] = "Statement"
    elif text == "Hello":
        x = "Hello"
    elif text == "Goodbye":
        x = "Goodbye"
    elif text == "Hi":
        x = "Hello"
    else:
        label1['text'] = "Please enter a valid statement"

    text = text2.get()
     
    if text == "":
        label2['text'] = "Question"
    elif text == "How are You?":
        y = "I'm going good"
    elif text == "What is your name?":
        y = "I'm Turing"
    elif text == "When did your Creator start working on you?":
        y = "In the year 2022"
    elif text == "Do you like Star Wars?":
        y = "Yes, I was actually inspired by the personallities from droids from Star Wars."
    else:
        label2['text'] = "please enter a valid question"
        
    print(x, y)


    if (x is not None) and (y is not None):
        label_result['text'] = str(x + " " + y)

# --- main ---

new = tk.Tk()


label1 = tk.Label(new, text="", fg="red")
label1.pack()

text1 = tk.Entry(new, width="60")  
text1.pack()


label2 = tk.Label(new, text="", fg="red")
label2.pack()

text2 = tk.Entry(new, width="60")  
text2.pack()
        
btn3 = tk.Button(new, text="Enter", command=cmd3)
btn3.pack()   


label_result = tk.Label(new, text="", fg="green")
label_result.pack()

new.mainloop()

I'll be so grateful for your help with this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source