Fragmentowanie tekstów

0

Poniższy ciąg zawiera zakodowaną wiadomość. Aby dowiedzieć się, co to jest, weź co piątą literę, zaczynając od pierwszej, a następnie odwróć kolejność. Spacje są tutaj traktowane jako symbole. Nie zapomnij wydrukować tego, co masz!

string = "no clouds here to spy on pets"

Zarys mojego rozwiązania:

string = "no clouds here to spy on pets"

deciphering_1 = print(string[0:32:5])

deciphering_2 = print((deciphering_1[0:32:-1]))

0

Coś takiego?

message = "no clouds here to spy on pets"
decoded = message[::5][::-1]
0
>>> "no clouds here to spy on pets"[::5][::-1]
'brainlet'

>>> 
0

Jak zinterpretować czwarty wers poniższego skryptu?

string = "no clouds here to spy on pets" sent='' for i in range(0,len(string),5): sent=sent+string[i:i+1] print (sent[::-1])

0

string = "no clouds here to spy on pets"
sent=''
for i in range(0,len(string),5):
sent=sent+string[i:i+1]
print (sent[::-1])

1 użytkowników online, w tym zalogowanych: 0, gości: 1