Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to ask a yes or no question on python

answer = input("Enter yes or no: ") 
if answer == "yes": 
    # Do this. 
elif answer == "no": 
    # Do that. 
else: 
    print("Please enter yes or no.") 
Comment

PREVIOUS NEXT
Code Example
Python :: pandas replace row values based on condition 
Python :: how to plotting bar on matplotlib 
Python :: python cheat sheet 
Python :: python unzip list of tuples 
Python :: merge three dataframes pandas based on column 
Python :: identify total number of iframes with Selenium 
Python :: short form of if statement in python 
Python :: python tkinter getting labels 
Python :: opencv python image capture 
Python :: python pandas apply function to one column 
Python :: pandas convert entries in a column after groupby in list 
Python :: remove unnamed 0 column pandas 
Python :: multiple variables in for loop python 
Python :: python progress bar 
Python :: how to make a list string in python 
Python :: post to instagram from pc python 
Python :: python count empty lines in text file 
Python :: python closure 
Python :: how to convert fahrenheit to celsius in python 
Python :: sort a list numbers in python 
Python :: np random seed 
Python :: python curve fitting 
Python :: Make a basic pygame window 
Python :: how to insert a variable into a string python 
Python :: python package version 
Python :: moving average pandas 
Python :: plt .show 
Python :: python printing variables 
Python :: remove hyperlink from text python 
Python :: how to rotate screen with python 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =