Skip to content

Instantly share code, notes, and snippets.

@felipecabargas
Last active December 16, 2015 21:29
Show Gist options
  • Save felipecabargas/5499725 to your computer and use it in GitHub Desktop.
Save felipecabargas/5499725 to your computer and use it in GitHub Desktop.
Check character type
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
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