alphabet = "abcdefghijklmnopqrstuvwxyz"
def encrypt(txt):
shift = int(input("Enter the shift: "))
new_txt = ""
for x in txt:
if x in alphabet:
if alphabet.index(x)+shift >= len(alphabet):
new_txt += alphabet[(alphabet.index(x)+shift - len(alphabet))]
else:
new_txt += alphabet[alphabet.index(x)+shift]
else:
new_txt += x
return new_txt
def decrpyt(txt):
shift = int(input("Enter the known shift: "))
new_txt = ""
for x in txt:
if x in alphabet:
new_txt += alphabet[alphabet.index(x) - shift]
else:
new_txt += x
return new_txt
print(encrypt("yellow dog."))
print(decrpyt("lryybj qbt."))
My code works with lowercase text only. If you need me to modify the code, I can do that. I tested my code with a shift of 13 in both the encryption and decryption. I hope this helps!
The correct answer to this question is the Review Ribbon.
In order to insert a comment you can insert one from the Review ribbon at the top. A faster way / shortcut to also insert a comment is to right click on the cell where you want to insert the comment. You can choose to insert a comment and then write the comment using this method, rather than trying to find the icon on the ribbon at the top.
The correct answer is MAC (Media Access Control).
<h3>What is MAC?</h3>
The Media Access Control (MAC) protocol is a data link layer protocol that defines the process by which local area network (LAN) devices interface with upper network layer protocols, such as the Internet Protocol (IP).
The MAC protocol is responsible for controlling access to the shared communication medium of the LAN and for providing a reliable link between devices on the LAN. It does this by defining a set of rules and procedures for how devices on the LAN can detect and avoid collisions when transmitting data, as well as for how they can recover from errors that may occur during transmission.
The MAC protocol is typically implemented in hardware, such as in the network interface controller (NIC) of a computer, and is an essential part of the LAN communication process.
To Know More About MAC, Check Out
brainly.com/question/29388563
#SPJ1
<span>Operating System is the software that gives the computer instructions on how to run applications. It is considered the most important program that runs on a computer because it manages all the hardware and software on it. It also controls the display/keyboard. </span>