Snippets

SeanB Python - question in def

Created by SeanB
1
2
3
4
5
6
7
8
def question(question_text):
    answer = raw_input(question_text+"\t")
    answer = answer.lower()
    return (answer=="y") or (answer=="yes")
    
if question("is this ok"):
    print "answered yes"

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.