Python 2.7

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.732873185031397","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"ZGVmIGVuY29kZSh0ZXh0KToKICAgIGFscGhhYmV0ID0gImFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6IgogICAgbnVtYmVycyA9ICIiCiAgICBuZXd0ZXh0ID0gIiIKICAgIGZvciBpIGluIHRleHQ6CiAgICAgICAgaW5kZXggPSBzdHIoYWxwaGFiZXQuaW5kZXgoaSkpCiAgICAgICAgbnVtYmVycyArPSAiMCIgKiAoMi1sZW4oaW5kZXgpKSArIGluZGV4CiAgICBudW1iZXJzID0gbnVtYmVyc1s6Oi0xXQogICAgaSA9IDAKICAgIHdoaWxlIGkgPCBsZW4obnVtYmVycyk6CiAgICAgICAgaWYgaSsxIDwgbGVuKG51bWJlcnMpIGFuZCBpbnQobnVtYmVyc1tpXStudW1iZXJzW2krMV0pIDw9IDI1OgogICAgICAgICAgICBuZXd0ZXh0ICs9IGFscGhhYmV0W2ludChudW1iZXJzW2ldICsgbnVtYmVyc1tpKzFdKV0KICAgICAgICAgICAgaSArPSAxCiAgICAgICAgZWxzZToKICAgICAgICAgICAgbmV3dGV4dCArPSBhbHBoYWJldFtpbnQobnVtYmVyc1tpXSldCiAgICAgICAgaSArPSAxCiAgICByZXR1cm4gbmV3dGV4dAoKd2hpbGUgVHJ1ZToKICAgIHByaW50IGVuY29kZShyYXdfaW5wdXQoKSkKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCg=="},"asBuffer":null},"loaded":true}}
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
def encode(text):
    alphabet = "abcdefghijklmnopqrstuvwxyz"
    numbers = ""
    newtext = ""
    for i in text:
        index = str(alphabet.index(i))
        numbers += "0" * (2-len(index)) + index
    numbers = numbers[::-1]
    i = 0
    while i < len(numbers):
        if i+1 < len(numbers) and int(numbers[i]+numbers[i+1]) <= 25:
            newtext += alphabet[int(numbers[i] + numbers[i+1])]
            i += 1
        else:
            newtext += alphabet[int(numbers[i])]
        i += 1
    return newtext

while True:
    print encode(raw_input())