need some help in the following code as it goes into infinite loop and does not validate user input: the get_offset is the function. Just edited need some help with the encryption part to be done in a function defined
def get_offset(offset):
while True:
value = (offset)
if value < 1:
print("")
if value > 94:
print("")
return offset
my_details = display_details()
get_choice = get_menu_choice()
print(my_details)
print(get_choice)
count = 10
while count > 0:
count -=1
encrypted = ""
choice = int(input("What would you like to do [1,2,3,4,5]: "))
while choice <1 and choice > 5:
print("Invalid choice, please enter either 1, 2, 3, 4 or 5.")
if choice == 1:
string_input = input("Please enter string to encrypt: ")
input_offset = get_offset(int(input("Please enter offset value (1 to 94): ")))
**for letter in string_input:
x = ord(letter)
encrypted += chr(x + input_offset)
if x < 32:
x += 94
if x > 126:
x -= 94
print(encrypted)**