SHARE
TWEET

Untitled

a guest Oct 15th, 2019 157 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def ZasifrujZnak (znak,a,b):
  2.     abeceda = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","R","Q","S","T","U","V","W","X","Y","Z"]
  3.     znakcislo = abeceda.index(znak)
  4.     znak_cislo_sifra = (a*znakcislo+b)%26
  5.     zasifrovanyznak=abeceda[znak_cislo_sifra]
  6.     return zasifrovanyznak
  7.  
  8.  
  9. znakOT = "D"
  10. a = 7
  11. b = 5
  12. z = []
  13.  
  14. text = "AHOJ PEPO"
  15.  
  16. text = text.replace(" ","XMEZERAX")
  17.  
  18. text = text.replace("Ě","E")
  19. text = text.replace("Š","S")
  20. text = text.replace("Č","C")
  21. text = text.replace("Ř","R")
  22. text = text.replace("Ž","Z")
  23. text = text.replace("Ý","Y")
  24. text = text.replace("Á","A")
  25. text = text.replace("Í","I")
  26. text = text.replace("É","E")
  27. text = text.replace("Ť","T")
  28. text = text.replace("Ď","D")
  29. text = text.replace("Ň","N")
  30. text = text.replace("Ú","U")
  31. text = text.replace("Ů","U")
  32.  
  33.  
  34. text = text.replace("0","XYA")
  35. text = text.replace("1","XYB")
  36. text = text.replace("2","XYC")
  37. text = text.replace("3","XYD")
  38. text = text.replace("4","XYE")
  39. text = text.replace("5","XYF")
  40. text = text.replace("6","XYG")
  41. text = text.replace("7","XYH")
  42. text = text.replace("8","XYI")
  43. text = text.replace("9","XYJ")
  44.  
  45. p = []
  46.  
  47. for i in range(0, len(text)):
  48.     znakST = ZasifrujZnak(text[i], a, b)
  49.     z.append(znakST)
  50. p = "" .join(z)
  51. print(p)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top