Created
December 2, 2015 22:38
-
-
Save nullset2/0f217e7f0debddcfa930 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
while True: | |
input_str = raw_input("What's your name? ") #reads user input | |
if ( re.match('[0-9]+', input_str) ): # while the input doesn't match the pattern "one or more numbers in the string" | |
print "Your name must NOT include numbers." #error out of the program | |
else: | |
break | |
print "if you see this, the entered name fullfilled the logical condition" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment