Radio button has a circular shape and used when one choice is to be selected from multiple options. This button is in the selected state when the circle is filled and deselected when the circle is hollow. QRadioButton class is used to add a radio button in an application.
A window asking the user to select user’s gender. According to the user’s choice, it shows a message: “You are male/female” and which will change if the user changes his/her selection.
Below is the code:
According to user’s choice a message will appear “You are male” or “You are female” and which will change as user changes his/her selection.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course