I am trying to put some python code into a javascript function so that I can call it on a button click. I was just wondering if there was a tag or some built-in way to code python inside a javascript function? I know that I may be able to do this by asking the function to open a file or something like that, but if there is a way to contain this entire solution inside one file that would be great.
This is the code I'm trying to put into the function:
user_input = input("input text here: ")
cipher_key = int(input("input cipher key here: "))
for x in user_input:
if x == " ":
print(x)
else:
ord_num = ord(x)
alf_num = ord_num - 97 + cipher_key
en_num = alf_num % 26 + 97
print(chr(en_num))