Category : return

I am trying to create a vignere cipher class that has the function to encrypt and decipher, vignere ciphers. However my code is returning the wrong characters and I was wondering if anyone could help me identify my problem. class Vignere(): def __init__(self): self.alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" self.enc_key = input("Please enter encription word: ") def vignere_encrypt(self, ..

Read more

quick question since I was not able to find a sufficient answer online. Following code snippet: def Credentials (x, y): list = [("test", 1234), ("test2", 4567)] for list in list: if list[0] == userinput1 and list[1] == userinput2: print("success") return True else: print("error") return False userinput1 = str(input("provide username: ")) userinput2 = int(input("provide PW: ")) ..

Read more

How my code works is in two steps. I have one file called filter.py which filters my dataframe according to inputs. In this file there is a function update_df() which returns data_filtered def update_df(ToEmail, FromEmail, ToJob, FromJob, Date): FromEmailF = (data[‘fromEmail’] == FromEmail) ToEmailF = (data[‘toEmail’] == ToEmail) FromJobF = (data[‘fromJob’] == FromJob) ToJobF = ..

Read more

I keep on getting the error statement "local variable ‘answer’ referenced before assignment" I am confused on the fix this. I want to be able to encryptionthingy(‘mason’) and then have print(encryptionthingy(‘mason’) return NGTWN. ultimate_key = 1618033988749894848204586834365638117720309179805762862135448622705260462818902449707207204189391137484754088075386891752126633862223536 best_key = str(ultimate_key) alphabet = [‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’, ‘I’, ‘J’, ‘K’, ‘L’, ‘M’, ‘N’, ..

Read more