Question: Can you explain the following codes doing line by line, like add comments to codes to show what the lines are doing: import sys def

Can you explain the following codes doing line by line, like add comments to codes to show what the lines are doing:

import sys def form_cube(n): i = 1 ret = [] while i*n<26: i+=1 j = 0 while j25): c-=26 temp.append(chr(ord('A')+c)) else: temp.append(chr(ord('a')+c)) k+=1 ret.append(temp) j+=1 return ret def search(s,lst): i = 0 while i25): print("key1 invalid value") exit(3) if(key2<0 or key2>25): print("key2 invalid value") exit(4) plain = "" try: f = open(fname) plain = f.read().lower() except: print("Could not open file") exit(5) cube = form_cube(key1) cipher = encrypt(plain,cube,key2) print(cipher)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!