Deutsch   English   Français   Italiano  
<8ridnf3Ir8p9rb__nZ2dnUU7_8zNnZ2d@giganews.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: buffer2.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 04 Mar 2022 09:31:43 -0600
Newsgroups: fr.comp.lang.python
Subject: Aide pour coder un scrypt de cryptograhpie
X-poster: PEAR::Net_NNTP v1.5.0 (stable)
From: taarco <nospam_taarco.moi@gmail.com.invalid>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
Organization: !No_Organization!
Message-ID: <8ridnf3Ir8p9rb__nZ2dnUU7_8zNnZ2d@giganews.com>
Date: Fri, 04 Mar 2022 09:31:44 -0600
Lines: 18
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-rZjh8fBmvMdo4ZS4IlccbIdvbixgnFIQDw5QMYG6RPqcbtJf0fgf1oQJ8fO8HlS8+EUVSxYwlIUc+Hm!W9uQ+nSvbnmFfuF1rA/GIgoC1FZpF8Z2QNi76PBcpZZnPGFj0+EZTyv5IfkR7CQe0OUTWwr1Bvyk
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
Bytes: 1693
X-Original-Lines: 17

Bonjour, j'ai commencé à créer mon code qui doit crypter un message à l'aide
d'une clé (C'est un devoir à rendre), mais je suis bloqué, et je en sais plus
comment faire, quelqu'un pourrait m'aider ? Voici mon code :

import random

alphabet = [i for i in 'abcdefghijklmnopqrstuvwxyz '] #liste par compréhension
phrase = input("Ecrivez une phrase:").lower()
clee=int(input("Clée :"))

Alphabet_Melange=[i for i in 'abcdefghijklmnopqrstuvwxyz ']
random.shuffle(Alphabet_Melange)
print(Alphabet_Melange)
final=""
for i in phrase:
    n_Lettre = alphabet.index(i)
    print(n_Lettre)
    final+=Alphabet_Melange[n_Lettre]
print(final,Alphabet_Melange)