Last active
December 16, 2015 21:29
-
-
Save felipecabargas/5499725 to your computer and use it in GitHub Desktop.
Check character type
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
def is_number(n): | |
try: | |
float(n) | |
return True | |
except ValueError: | |
return False | |
def is_symbol(n): | |
if n.isalnum() == False: | |
return True | |
else: | |
return False |
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
from nonalphabetic import * | |
quees = raw_input(">>> ") | |
if is_number(quees) == True: | |
print "Es numero." | |
elif is_symbol(quees) == True: | |
print "No es letra ni numero." | |
elif quees == quees.upper(): | |
print "Es letra mayuscula." | |
elif quees == quees.lower(): | |
print "Es letra minuscula" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment