[Python] Python loop through X and Y values [closed]

Discussão em 'Python' iniciado por Stack, Setembro 29, 2024.

  1. Stack

    Stack Membro Participativo

    I'm currently looking at a piece of code:

    def GenerateFlagText(x, y):
    key = x + y*20
    encoded = "\xa5\xb7\xbe\xb1\xbd\xbf\xb7\x8d\xa6\xbd\x8d\xe3\xe3\x92\xb4\xbe\xb3\xa0\xb7\xff\xbd\xbc\xfc\xb1\xbd\xbf"
    return ''.join([chr(ord(c) ^ key) for c in encoded])


    I'm not great witth python though. Is there a way to loop through x,y values and then print the result of the encoded values?

    for x in range(3): # Loop through x values
    for y in range(2): # Loop through y values
    print(''.join([chr(ord(c) ^ key) for c in encoded]))

    Continue reading...

Compartilhe esta Página