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
  encryption and decryption with python ibrahim 1 342 May-16-2020, 03:14 PM
Last Post: Larz60+
  Python Speech recognition, word by word AceScottie 6 8,973 Apr-12-2020, 09:50 AM
Last Post: vinayakdhage
  write an integer to file using a function xvkxvo 4 675 Dec-10-2019, 11:27 PM
Last Post: xvkxvo
  File encryption itzik 5 491 Nov-05-2019, 12:29 PM
Last Post: Gribouillis
  print a word after specific word search evilcode1 8 814 Oct-22-2019, 08:08 AM
Last Post: newbieAuggie2019
  Beginner at Python. Trying to count certain integer from random string of code kiaspelleditwrong 3 628 Oct-14-2019, 10:40 AM
Last Post: perfringo
  A function for correctly using "a/an" before a word Exsul1 2 671 Oct-07-2019, 07:51 PM
Last Post: newbieAuggie2019
  Vernam encryption method for files JohnCTX 1 501 Sep-18-2019, 04:31 PM
Last Post: JohnCTX
  python cache for small integer Uchikago 1 796 Jun-27-2019, 05:32 PM
Last Post: ichabod801
  Regarding encryption and decryption naressh1994 1 712 Jan-25-2019, 07:26 AM
Last Post: buran

Forum Jump:

User Panel Messages

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