[Python] Python - Encode & Check[Python] Python - Encode & Check

🔗

URL Shortener

Week 11, 2026

increment = 2611 start = 0 ans = [] def encode_to_base36(n): if n == 0: return "0" alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" base36 = "" while n: n, rem = divmod(n, 36) base36 = alphabet[rem] + base36 return base36 for x in range(increment): temp = x temp36 = encode_to_base36(temp) while len(str(temp36)) <= 3: ans.append([temp, (str("000")+str(temp36))[-3:]]) temp += increment temp36 = encode_to_base36(temp) file = open("ans.txt", 'w') for a in ans: file.write(f"{a[0]} : {a[1]}" + '\n') file.close()