Question: I need help with adding the weighted points at the end of every subject please in python def validate _ input ( message , offset
I need help with adding the weighted points at the end of every subject please
in python
def validateinputmessage offset:
if not offset :
return False
for char in message:
if not charisalpha or char.isspace:
return False
return True
def caesarciphermessage offset:
encryptedmessage
for char in message:
if char.isalpha:
shifted ordcharupper offset
if shifted ordZ:
shifted # Wrap around if it goes past Z
encryptedmessage.appendchrshifted
else:
encryptedmessage.appendchar
return joinencryptedmessage
def main:
while True:
message inputEnter your message:
try:
offset intinputEnter the offset value:
except ValueError:
printOffset must be an integer."
continue
if validateinputmessage offset:
encryptedmessage caesarciphermessage offset
printf
Your secret message isencryptedmessage
else:
print
"Sorry, we can only process messages with letters and spaces, and the offset must be between and
another input
Do you want to encrypt another message?: striplower
if another y:
print
Closing out..."
break
if namemain:
main
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
