i need to convert this function in C to Python:
void myencrypt(char password[],int mkey)
{
unsigned int i;
for(i=0;i<strlen(password);++i)
{
password[i] = password[i] - mkey;
}
}
I try this, but fails...
def myencrypt(password, mkey):
i = 0
newpass = []
for i in range(len(password)):
newpass[i] = ord(password[i]) - mkey;
return newpass
any help ?