fadliaulawi's picture
Separate validation code
8503206
raw
history blame
539 Bytes
import requests
import time
# Common mistakes need to be maintained
mistakes = {'I': '1', 'O': '0'}
def permutate(word):
if len(word) == 0:
return ['']
change = []
res = permutate(word[1:])
if word[0] in mistakes:
change = [mistakes[word[0]] + r for r in res]
return [word[0] + r for r in res] + change
def call(url):
while True:
try:
res = requests.get(url)
time.sleep(1)
break
except Exception as e:
print(e)
return res