Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- listeM = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
- listeM += listeM
- listem = 'abcdefghijklmnopqrstuvwxyz'
- listem += listem
- listex = ',;:!?./§%¨^*£$¤}=+°)]^ç\'_`|-[({"~&0123456789çéèàùûêôîâ'
- listex += listex
- message = input('Entrez votre message : ')
- cle = int(input('Entrez votre clef : '))
- def chiffrage_lettre(lettre,listeM,listem,listex,cle):
- for i in range(len(listeM)):
- if listeM[i]==lettre:
- return str(listeM[i+cle])
- elif lettre==' ': #au cas ou il y a un espace
- return ' '
- for m in range (len(listem)):
- if listem[m]==lettre:
- return str(listem[m+cle])
- elif lettre==' ': #au cas ou il y a un espace
- return ' '
- for x in range (len(listex)):
- if listex[x]==lettre:
- if lettre=='é':
- return str(listem[4+cle])
- else:
- if lettre=='è':
- return str(listem[4+cle])
- else:
- if lettre=='ê':
- return str(listem[4+cle])
- else:
- if lettre=='à':
- return str(listem[0+cle])
- else:
- if lettre=='â':
- return str(listem[0+cle])
- else:
- if lettre=='ù':
- return str(listem[20+cle])
- else:
- if lettre=='û':
- return str(listem[20+cle])
- else:
- if lettre=='ô':
- return str(listem[14+cle])
- else:
- if lettre=='î':
- return str(listem[8+cle])
- else:
- if lettre=='ç':
- return str(listem[2+cle])
- else:
- return str(listex[x])
- elif lettre==' ': #au cas ou il y a un espace
- return ' '
- message_chiffre = str()
- for lettre in message:
- message_chiffre += chiffrage_lettre(lettre,listeM,listem,listex,cle)
- print(message_chiffre)
Advertisement
Add Comment
Please, Sign In to add comment