Skip to content

Instantly share code, notes, and snippets.

@Haylin-chama
Created November 11, 2014 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Haylin-chama/63a924a42dca9b3b0e13 to your computer and use it in GitHub Desktop.
Save Haylin-chama/63a924a42dca9b3b0e13 to your computer and use it in GitHub Desktop.
Tarea
def ValidarNombre(dato):
a=str(dato)
l=len(dato)
for i in range(l):
if not a[i]>='a' and a[i]<='z' or a[i]>'A' and a[i]<='Z' or a[i]==' ':
return False
return True
def ValidarEdad(dato):
a=dato
l=len(dato)
l
for i in range(l):
if not a[i]>='0' and a[i]<='9':
return False
return True
def ValidarNota(dato):
if not float(dato)>=1.0 and float(dato)<=7.0:
return False
else:
return True
def ValidarReal(dato):
print "meh"
def ValidarEntero(dato):
if float(dato)==int(dato):
return True
else:
return False
def ValidarRut(dato):
value = 11 - sum([ int(a)*int(b) for a,b in zip(str(rut).zfill(8), '32765432')])%11
return {10: 'K', 11: '0'}.get(value, str(value))
def main():
dato=raw_input("HJSAGDJASDG: ")
print ValidarEdad(dato)
datiwi=raw_input("Nota: ")
print ValidarNota(datiwi)
if __name__=="__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment