File size: 539 Bytes
8503206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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