Jump to content
far

Am nevoie de ajutor pentru un program

Recommended Posts

Vreau si eu sa fac un mic program si sa faca urmatorul lucru:

Eu scriu de exemplu "salut ce faci?" si programul sa imi traduca fraza aia intr-un anumit cod care sa il pun eu, de exemplu "$!"$%&&$" (fiecare simbol din ala ii pun eu o litera...a, b, c, etc), si un al doilea individ care are programul sa poata sa traduca codul ala si sa vada ce i-am scris....nu cer sa imi spuneti cum sa fac pas cu pas, macar ce limbaj de programare sa folosesc si cum sa incep..mersi

Link to comment
Share on other sites

Un script simplu pentru "criptare", in python 2.7.

dictionar = {"a": "1", "b": "2", "c": "3", "d": "4", "e": "5", "f": "6", "g": "7", "h": "8", "i": "9",

"j": "~", "k": "!", "l": "@", "m": "#", "n": "$", "o": "%", "p": "^", "q": ":", "r": "&",

"s": "*", "t": "+", "u": "=", "v": "|", "w": "_", "x": ".", "y": ",", "z": "0", " ": "`", "?":">"}

text = "salut ce faci?"

textcriptat = ""

for i in text:

if i in dictionar.keys():

textcriptat += dictionar

else:

print "n-am gasit inlocuitor pentru: " + str(i)

print textcriptat

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...