Snippets

SeanB Python - question in def

Created by SeanB

File question.py Added

  • Ignore whitespace
  • Hide word diff
+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"
+
HTTPS SSH

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