Python decryption of Caesar Cipher Given this ciphertext from a Caesar cipher:

fxeyaxklqxhkltkxqebobxtbobxplxjykvxfaflqpxfkxqebxtloiaxrkqfixfxpqyoqbaxrpfkdxqebxfkqbokbq

The task is to decrypt it without being given the key.
My solution:
napis = &quot;fxeyaxklqxhkltkxqebobxtbobxplxjykvxfaflqpxfkxqebxtloiaxrkqfixfxpqyoqbaxrpfkdxqebxfkqbokbq&quot;.upper()
ALPHABET = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ &quot;
napis = [ALPHABET.index(i) for i in napis]

for x in range(0,4):
    wynik = [ALPHABET[i+x] if i+x&lt;len(ALPHABET) else ALPHABET[i+x-len(ALPHABET)] for i in napis]
    print(&quot;&quot;.join(wynik))

output:
FXEYAXKLQXHKLTKXQEBOBXTBOBXPLXJYKVXFAFLQPXFKXQEBXTLOIAXRKQFIXFXPQYOQBAXRPFKDXQEBXFKQBOKBQ
GYFZBYLMRYILMULYRFCPCYUCPCYQMYKZLWYGBGMRQYGLYRFCYUMPJBYSLRGJYGYQRZPRCBYSQGLEYRFCYGLRCPLCR
HZG CZMNSZJMNVMZSGDQDZVDQDZRNZL MXZHCHNSRZHMZSGDZVNQKCZTMSHKZHZRS QSDCZTRHMFZSGDZHMSDQMDS
I HAD NOT KNOWN THERE WERE SO MANY IDIOTS IN THE WORLD UNTIL I STARTED USING THE INTERNET
Don't use meaningless names like &quot;napis&quot; and &quot;wynik&quot;.
x and i are meaningful in some contexts, but not for what you're using them, so use better names for those as well.
You could take advantage of negative indices, i.e., remove ALPHABET[i+x] if i+x&lt;len(ALPHABET) else  and just use ALPHABET[i+x-len(ALPHABET)]. Or, more generally, ALPHABET[(i+x) % len(ALPHABET)].
You could assume that spaces are the most frequent characters and do x = ALPHABET.index(' ') - max(napis, key=napis.count) instead of the loop.