I want my entry to check the length of the name I type in the entry widget and to return it in lowercase. So when you click on the print button it prints the name you entered in lowercase.
Challenge:
It doesn't print the name you entered when I click on print button but it prints the id of the journalist
function.
from tkinter import messagebox
from tkinter import *
def journalist():
name = input("please enter journalist name:")
if len(name) > 15: # checks the length of your input
messagebox.showerror("error,message=name more than length of '15' ")
return(name.lower()) # converts the name string entered to lowercase
def print_journalist_name():
print(journalist)
# To print name entered
root = Tk()
root.geometry("300x300")
news = StringVar()
label = Label(text="Name").place(x=5, y=100)
entry = Entry(root, width=40, textvariable=news).place(x=45, y=100)
button = Button(root, text="Print", command=print_journalist_name).place(x=90, y=200)
root.mainloop()