TRABAJO FINAL AGENTES BIEN

Páginas: 4 (785 palabras) Publicado: 22 de octubre de 2015
INSTITUTO POLITÉCNICO NACIONAL
ESCUELA SUPERIOR DE INGENIERÍA MECÁNICA ELÉCTRICA

INGENIERÍA EN COMUNICACIONES Y ELECTRÓNICA

ENTREGA DE REPORTES DE PRÁCTICA #1 Y PRÁCTICA #2:

CIFRADO DE TEXTODOBLE; ROMPECABEZAS LINEAL EN PYTHON


AGENTES INTELIGENTES EXPERTOS

INTEGRANTES DEL EQUIPO:

NUÑEZ PEZA MONSERRATH

DANIEL ANTONIO TORRES VIQUEZ

RAMÍREZ ROSARIO CARLOS GIOVANI

ENTREGA DE REPORTES DEPRÁCTICA #1 Y PRÁCTICA #2:
CIFRADO DE TEXTO DOBLE; ROMPECABEZAS LINEAL EN PYTHON





FECHA: 5/Octubre/2015.
CÓDIGO PRÁCTICA #1.
CIFRADO DOBLE DE TEXTO.
#coding: utf-8
from string importletters,punctuation,digits
class Mensaje(object):
def __init__(self, pivote):
'''
Constructor de la clase
'''
self.vocabulario = letters[:52] + punctuation + digits + " "self.mensaje = ""
self.pivote = self.vocabulario.find(pivote)

def cifra(self, mensaje):
self.mensaje = ""
mensaje = list(mensaje)
for item in mensaje:idx = self.vocabulario.find(item)
if idx > -1:
idx += self.pivote
self.mensaje += self.vocabulario[idx%len(self.vocabulario)]
else:self.mensaje += item
return self.mensaje

def descifra(self):
temp = ""
mensaje = list(self.mensaje)
for item in mensaje:
idx =self.vocabulario.find(item)
if idx > -1:
idx -= self.pivote
temp += self.vocabulario[idx%len(self.vocabulario)]
else:
temp += itemprint temp
class Desc(object):
def __init__(self, pivote):
'''
Constructor de la clase
'''
self.vocabulario = letters[:52] + punctuation + digits + " "self.mensaje = ""
self.pivote = self.vocabulario.find(pivote)

def frado(self, mensaje):
self.mensaje = ""
mensaje = list(mensaje)
for item in mensaje:...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Agente De Bienes Raíces
  • TRABAJO BIENES
  • trabaja bien
  • El Trabajo De Bien
  • TUS TRABAJOS BIEN!!
  • trabajo bien
  • TRABAJO BIEN
  • Trabajo Bienes

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS