Can someone help me put some comments in these to helpunderstand what is going on.

1.

rstr = ”
for i in range(start, end+1):
rstr += chr(i)
return rstr

2.

key = remove_duplicates(password)
alphabet = gen_consecutive_chars()
alphabet = alphabet.split(key[-1])
alphabet[0] = remove_letters(key,alphabet[0])
alphabet[1] = remove_letters(key,alphabet[1])
key = key + alphabet[1] + alphabet[0]
return key

3.

key = gen_key(password)
alpha = gen_consecutive_chars()
ciphertext = ciphertext.lower()
rstr = ”
for i in ciphertext:
if i in key:
rstr += alpha[key.index(i)]
else:
rstr += i
return rstr

4.

rstr = ”
alpha = gen_consecutive_chars()
for i in range(len(message)):
row_letter = key[i % len(key)].lower()
offset = alpha.index(row_letter)
try:
col_letter = alpha[(alpha.index(message[i]) – offset) %len(alpha)]
rstr += col_letter
except ValueError:
rstr += message[i]
return rstr

if __name__ == ‘__main__’:
print(gen_consecutive_chars())
print(gen_key(‘topsecret’))
s = ‘we are discovered. flee at once.’
r = sub_encrypt(‘topsecret’, s)
print(r)
print(sub_decrypt(‘topsecret’, r))
s = ‘the eagle has landed’
r = vig_encrypt(‘DAVINCI’, s)
print(r)
print(vig_decrypt(‘DAVINCI’, r))