mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-23 20:11:07 +00:00
Fixing number input
This commit is contained in:
parent
53ba4f64a5
commit
bc61e2358e
|
@ -15,12 +15,14 @@ def decryption(key, text):
|
||||||
count += 1
|
count += 1
|
||||||
else:
|
else:
|
||||||
real_key += ' '
|
real_key += ' '
|
||||||
print(real_key)
|
#print(real_key)
|
||||||
encr = ''
|
encr = ''
|
||||||
#decrypting
|
#decrypting
|
||||||
for c in range(0,len(text)):
|
for c in range(0,len(text)):
|
||||||
if text[c] == ' ':
|
if text[c] == ' ':
|
||||||
encr += ' '
|
encr += ' '
|
||||||
|
elif ((ord(text[c]) >= 48) and (ord(text[c]) <= 57)):
|
||||||
|
encr += text[c]
|
||||||
else:
|
else:
|
||||||
encr += (alph[(ord(text[c]) - ord(real_key[c])) % 26])
|
encr += (alph[(ord(text[c]) - ord(real_key[c])) % 26])
|
||||||
return encr
|
return encr
|
||||||
|
@ -40,12 +42,14 @@ def encryption(key, text):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
real_key += ' '
|
real_key += ' '
|
||||||
print(real_key)
|
#print(real_key)
|
||||||
encr = ''
|
encr = ''
|
||||||
#encrypting
|
#encrypting
|
||||||
for c in range(0,len(text)):
|
for c in range(0,len(text)):
|
||||||
if text[c] == ' ':
|
if text[c] == ' ':
|
||||||
encr += ' '
|
encr += ' '
|
||||||
|
elif ((ord(text[c]) >= 48) and (ord(text[c]) <= 57)):
|
||||||
|
encr += text[c]
|
||||||
else:
|
else:
|
||||||
encr += (alph[(ord(real_key[c]) + ord(text[c])) % 26])
|
encr += (alph[(ord(real_key[c]) + ord(text[c])) % 26])
|
||||||
return encr
|
return encr
|
||||||
|
|
Loading…
Reference in New Issue
Block a user