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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package javaapplication1algo; | |
import java.util.*; | |
/** | |
* |
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 time | |
#Usuario=[Nombre,contraseña,fecha_incorporacion] | |
#Multimedia=open("imagen.jpg") | |
def Crear(): | |
Usuarios=open("Usuarios.txt",r+) | |
Nombre=input("Nombre de usuario: ") | |
Contraseña=input("Contraseña: ") | |
Repetir=input("Repetir Contraseña: ") |
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 time | |
#Usuario=[Nombre,contraseña,fecha_incorporacion] | |
#Multimedia=open("imagen.jpg") | |
def Crear(): | |
Usuarios=open("Usuarios.txt",r+) | |
Nombre=input("Nombre de usuario: ") | |
Contraseña=input("Contraseña: ") | |
Repetir=input("Repetir Contraseña: ") |
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
#0. VALIDACIONES | |
def Validar(): | |
a=input("Valor: ") | |
if a.isdigit(): #Función para corroborar que una línea de caracteres corresponden exclusivamente a números | |
#Es una función bool de verdadero o falso | |
return int(a) | |
else: | |
print ("Ingrese un valor numérico.") | |
return Validar() | |
#Funcion que se llama a si misma en caso que no sea una linea |
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
#Dijkstra | |
#Aplicación del algoritmo visto en clases | |
#0. Validaciones | |
def Validar(): | |
a=input("Valor: ") | |
if a.isdigit(): #Función para corroborar que una línea de caracteres corresponden exclusivamente a números | |
#Es una función bool de verdadero o falso | |
return int(a) |
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
A B 7 | |
A D 5 | |
B C 8 | |
B E 7 | |
D E 15 | |
D F 6 | |
F E 8 | |
F G 11 | |
E G 9 | |
C E 5 |
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
# Dijkstra's algorithm for shortest paths | |
# David Eppstein, UC Irvine, 4 April 2002 | |
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117228 | |
from priodict import priorityDictionary | |
def Dijkstra(G,start,end=None): | |
D = {} # dictionary of final distances | |
P = {} # dictionary of predecessors | |
Q = priorityDictionary() # est.dist. of non-final vert. |
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 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 |
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 TotalConducido(CodigoConductor,txt): | |
horas=0 | |
for linea in txt: | |
dato=linea.split("#") | |
if dato[2]==CodigoConductor: | |
horas=horas+dato[3] | |
return horas | |
def MostrarConductores(txt): | |
for linea in txt: |
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
#Nombre: funciones | |
#Autor: Equipo Pokeweas Python | |
#Fecha: 28-10-2014 | |
#Descripcion: Tarea Final (funciones) | |
import random | |
def Validar(): | |
a=raw_input("Valor: ") | |
if a.isdigit(): #Funcion para corroborar que una linea de caracteres correspondan exclusivamente a numeros |
NewerOlder