Advertisement
PowerCell46

Decipher This! Python

Jan 1st, 2023
1,571
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.42 KB | None | 0 0
  1. list_of_decripted_words = (str(input())).split()
  2. print_result = ""
  3.  
  4. for index in range(0, len(list_of_decripted_words)):
  5.     current_decrypted_word = (list_of_decripted_words[index])
  6.     current_decrypted_word_list = []
  7.     for letter in current_decrypted_word:
  8.         current_decrypted_word_list.append(letter)
  9.     first_digit = current_decrypted_word_list.pop(0)
  10.     second_digit = current_decrypted_word_list.pop(0)
  11.     digits = first_digit + "" + second_digit
  12.     if current_decrypted_word_list[0] == "1" or current_decrypted_word_list[0] == "2" or  current_decrypted_word_list[0] == "3" or current_decrypted_word_list[0] == "4" or current_decrypted_word_list[0] == "5" or current_decrypted_word_list[0] == "6" or current_decrypted_word_list[0] == "7" or current_decrypted_word_list[0] == "8" or current_decrypted_word_list[0] == "9" or current_decrypted_word_list[0] == "0":
  13.         third_digit = current_decrypted_word_list.pop(0)
  14.         digits += third_digit
  15.  
  16.     first_letter = chr(int(digits))
  17.     if len(current_decrypted_word_list) > 1:
  18.         second_letter = current_decrypted_word_list.pop(0)
  19.         last_letter = current_decrypted_word_list.pop()
  20.         current_decrypted_word_list.insert(0, last_letter)
  21.         current_decrypted_word_list.append(second_letter)
  22.     current_decrypted_word_list.insert(0, first_letter)
  23.  
  24.     print_result+= ("".join(current_decrypted_word_list) + " ")
  25.  
  26. print(print_result)
  27.  
  28.  
Advertisement
Comments
  • User was banned
    • PowerCell46
      2 years
      # text 0.19 KB | 0 0
      1. You are absolutely correct. I am just pasting the solution of a task that I've done for my university, which is named Desipher this! I didn't mean for anyone to actually try and desipher it. :)
Add Comment
Please, Sign In to add comment
Advertisement