Python EasyGUI – Yes No Box Last Updated : 10 Apr, 2023 Comments Improve Suggest changes Like Article Like Report Yes No Box : It is used to display a window having a two option yes or no in EasyGUI, it can be used where there is a need to get the answer of the question in form of yes or no, it displays two option yes or no for example when we want to ask user whether he is above 18 or not we will use yes no box, it is kind of similar to continue cancel box, below is how the continue cancel box looks like In order to do this we will use ynbox method Syntax : ynbox(message, title, choices) Argument : It takes 3 arguments, first string i.e message/information to be displayed, second string i.e title of the window and third is list having exactly two values which is two option for yes and no Return : It returns True is yes is pressed else False Example : In this we will create a yes no box, when any button is pressed it will show the specific message on the screen, below is the implementation Python3 # importing easygui module from easygui import * # message / information to be displayed on the screen message = "Are you a Geek ?" # title of the window title = "GfG - EasyGUI" # creating a yes no box output = ynbox(message, title) # if user pressed yes if output: # message / information to be displayed on the screen message = "Thats Great !!" # title of the window title = "GfG - EasyGUI" # creating a message box msg = msgbox(message, title) # if user pressed No else: # message / information to be displayed on the screen message = "You should become a Geek, go to GeeksforGeeks to become one" # title of the window title = "GfG - EasyGUI" # creating a message box msg = msgbox(message, title) Output : Another Example : In this we will create a yes no box and setting specific choice for yes and no button, when any button is pressed it will show the specific message on the screen, below is the implementation Python3 # importing easygui module from easygui import * # message / information to be displayed on the screen message = "Are you a Geek ?" # title of the window title = "GfG - EasyGUI" # choices for yes and no button choices = ["Agree", "Disagree"] # creating a yes no box output = ynbox(message, title, choices) # if user pressed yes if output: # message / information to be displayed on the screen message = "Thats Great !!" # title of the window title = "GfG - EasyGUI" # creating a message box msg = msgbox(message, title) # if user pressed No else: # message / information to be displayed on the screen message = "You should become a Geek, go to GeeksforGeeks to become one" # title of the window title = "GfG - EasyGUI" # creating a message box msg = msgbox(message, title) Output : Comment More infoAdvertise with us Next Article Python EasyGUI – Yes No Box R rakshitarora Follow Improve Article Tags : Python Python-gui Python-EasyGUI Practice Tags : python Similar Reads Python EasyGUI â Enter Box Enter Box : It is used to get the input from the user, input can be any keyboard input, it takes input in form of string. It displays the title, message to be displayed, place to enter a text and a pair of "Ok", "Cancel" button which is used confirm the input. Also we can set some default text to th 2 min read Python EasyGUI â Integer Box Integer Box : It is used to get the integer input from the user, input should be integer input not string which happens in enter box. It displays the title, message to be displayed, place to enter a integer input and a pair of "Ok", "Cancel" button which is used confirm the input. We can set some de 3 min read Python EasyGUI - Message Box Message Box : It is used to display a window having a message or information in EasyGUI, it can be used where there is a need to display some message or some important information, it contains message and a "Ok" button which when pressed closes the message, below is how the message box looks like 2 min read Python EasyGUI â Boolean Box Boolean Box : It is used to display a window having a multiple options i.e buttons in EasyGUI, it can be used where there is a need to get if the first selection option as it returns 1 for button having index 0 and for other button it returns 0, it is slightly different from index box, below is how 3 min read Python EasyGUI â Multi Choice Box Multi Choice Box : It is used to display a window having a multiple options i.e items in EasyGUI, it can be used where there is a need to select multiple item among a group of items, it consist of title, message to be displayed, group of items and buttons i.e "Cancel", "Select All", "Clear All", "Ok 2 min read Like