Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Encryption program in Python ๐Ÿ”
Play lesson

Python tutorial for beginners ๐Ÿ - Encryption program in Python ๐Ÿ”

4.0 (0)
8 learners

What you'll learn

This course includes

  • 14.3 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

#python #course #tutorial import random import string chars = " " + string.punctuation + string.digits + string.ascii_letters chars = list(chars) key = chars.copy() random.shuffle(key) #ENCRYPT plain_text = input("Enter a message to encrypt: ") cipher_text = "" for letter in plain_text: index = chars.index(letter) cipher_text += key[index] print(f"original message : {plain_text}") print(f"encrypted message: {cipher_text}") #DECRYPT cipher_text = input("Enter a message to encrypt: ") plain_text = "" for letter in cipher_text: index = key.index(letter) plain_text += chars[index] print(f"encrypted message: {cipher_text}") print(f"original message : {plain_text}")

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere