The radiobutton widget is used to display a number of options to a user as toggle buttons. The user can then select only one options by clicking the button corresponding to each option.
Syntax-
c=Radiobutton(window,option=value)
program-
from tkinter import *
#create a window screen
win=Tk()
win.geometry("400x350")
def show():
if var.get()==1:
data="You select Madhya pradesh"
if var.get()==2:
data="You select Bihar"
if var.get()==3:
data="You select Delhi"
l.config(text=data)
Label(win,text="Select City",bg="green",fg="White").place(x=80,y=70)
var=IntVar()
r1=Radiobutton(win,text="Madhya pradesh",variable=var,value=1,command=show)
r1.place(x=80,y=100)
r2=Radiobutton(win,text="Bihar",variable=var,value=2,command=show)
r2.place(x=80,y=120)
r3=Radiobutton(win,text="Delhi",variable=var,value=3,command=show)
r3.place(x=80,y=140)
l=Label(win,text="initially no one selected",bg="green",fg="White")
l.place(x=80,y=170)
#hold the screen
win.mainloop()