It is used to offer multi-choice option to the user. It offers several options to the user and the user has to choose one option.
The general syntax is:
rb = Radiobutton(win, option=value)
There are number of options which are used to change the format of this widget. Number of options can be passed as parameters separated by commas. Some of them are listed below.
Example:
from Tkinter import *
win=Tk()
win.title('My Radio Button')
win.geometry('350x250')
var=IntVar()
rb1=Radiobutton(win,text="Python",variable=var,value=1)
rb1.pack()
rb2=Radiobutton(win,text="Ruby",variable=var,value=2)
rb2.pack()
rb3=Radiobutton(win,text="Java",variable=var,value=3)
rb3.pack()
win.mainloop()