Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Use Python 3.7 and based on the test code alphabetABCDEFGHIJKLMNOPQRSTUVWXYZ ## encode and decode functions using string operations-write here what you did def encode_string (codestring,

Use Python 3.7 and based on the test code

image text in transcribed

image text in transcribed

alphabetABCDEFGHIJKLMNOPQRSTUVWXYZ ## encode and decode functions using string operations-write here what you did def encode_string (codestring, plaintext) pass def decode string (codestring, ciphertext) pass import unittest from cipher import * class TestCipher (unittest. TestCase) ## test string operation def testdecodestring (self) codest ring = ("BCDEFGHlJKLMlOPQRSTUTWXYZA-') self. assertEqual (decode string (codestring, "CDE), "BCD) self. assertEqual (decode string (codestring, "ZZZAB"), "YYYZA") self. assertNotEqual (decode string (codestring, "ABC "ABC def testdecodestringwithextras (self) codestring-(JMBCYEKLFDGUVWHINXRTOSPZQA-") self.assertEqual (decode string (Codestring, "TMB.-CY:."), "ABC, DE: self. assertEqual (decode string (codestring, self. assertEqual (decode string (codestring, 1234567..."), 1234567...") def testdecodestringwithlowercase(self) codest ring= ("JMBCYEKLFDGUTy/H1NXRTOSPZQA-') self. assertEqual (decode string (codestring, "jMb, -cy::"), ABC DE) self. assertEqual (decode string (codestring, " Aps#$!"), " def testencodestring (self) codest ring= ("BCDEFGH1JKLINOPQRSTUTWXYZA-') self. assertEqual (encode string(codestring, "DEF"EFG") self. assertEqual (encode string (codestring, "AAAB") "BBBC) self. assertNotEqual (encode string (codestring, "ABC ABC) def testencodestringwithlowercase(self) codest ring= ("JMBCYEKLFDGUTy/H1NXRTOSPZQA-') self.assertEqual (encode-string (codest ring, "Abc, self. assertEqual (encode string (codestring, self.assertNotEqual (encode-string (code string, " De::), "JMB,-CY:.") APS#5i"), " APS#$!") def testencodestringwithextras (self) codestring-(JMBCYEKLFDGUVWHINXRTOSPZQA-") self. assertEqual (encode_ string(codestring, "ABC, DE"), "JMB,-CY:") self.assertEqual (encode-string (codest ring, Zwv#$!"), " APS#$1) self. assertEqual (encode string (codestring, 1234567..."), 1234567...")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students explore these related Databases questions