Python Forum
Python function that uses a word as the encryption key, rather than an integer
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python function that uses a word as the encryption key, rather than an integer
#5
Reading this code I get little bit confused.

- why you import alphabet_position and then define function with same name?
- why you ask two times for letter?
- is it typo or functions rotate is not indented?

Instead of writing dictionary manually one can let Python create it:

alphabet_pos = {}

for i, v in enumerate(zip(range(65, 91), range(97, 123))):
    alphabet_pos.update({**dict.fromkeys([chr(v[0]), chr(v[1])], i)})
It is also not clear what function vigenere_cipher should accomplish.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
Encrypting the Vigenere cipher - by wak_stephanie - Aug-31-2018, 03:23 AM
RE: Python function that uses a word as the encryption key, rather than an integer - by perfringo - Aug-31-2018, 12:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help with function - encryption - messages - NameError: name 'message' is not defined MrKnd94 4 2,888 Nov-11-2022, 09:03 PM
Last Post: deanhystad
Question Problem: Check if a list contains a word and then continue with the next word Mangono 2 2,495 Aug-12-2021, 04:25 PM
Last Post: palladium
  Question about change hex string to integer sting in the list (python 2.7) lzfneu 1 2,528 May-24-2021, 08:48 AM
Last Post: bowlofred
  need help one time pad encryption implementation ! nad556 1 1,949 Nov-28-2020, 06:11 PM
Last Post: nad556
  encryption and decryption with python ibrahim 1 1,816 May-16-2020, 03:14 PM
Last Post: Larz60+
  Python Speech recognition, word by word AceScottie 6 16,000 Apr-12-2020, 09:50 AM
Last Post: vinayakdhage
  write an integer to file using a function xvkxvo 4 3,183 Dec-10-2019, 11:27 PM
Last Post: xvkxvo
  File encryption itzik 5 2,868 Nov-05-2019, 12:29 PM
Last Post: Gribouillis
  print a word after specific word search evilcode1 8 4,831 Oct-22-2019, 08:08 AM
Last Post: newbieAuggie2019
  Beginner at Python. Trying to count certain integer from random string of code kiaspelleditwrong 3 2,413 Oct-14-2019, 10:40 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020