lundi 16 janvier 2017

How to make all the random strings be different? [Python]

I'm starting to write a program that make all the letters from the alphabet be transformed in symbols and "codified".

import random

char = ("@", "#", "$", "%", "&", "*", "-", "¿", "=", "?", "~", "§", "!", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "£", "º", "°")

a = random.choice(char)
b = random.choice(char)
c = random.choice(char)
d = random.choice(char)
e = random.choice(char)
f = random.choice(char)
g = random.choice(char)
h = random.choice(char)
i = random.choice(char)
j = random.choice(char)
k = random.choice(char)
l = random.choice(char)
m = random.choice(char)
n = random.choice(char)
o = random.choice(char)
p = random.choice(char)
q = random.choice(char)
r = random.choice(char)
s = random.choice(char)
t = random.choice(char)
u = random.choice(char)
v = random.choice(char)
w = random.choice(char)
x = random.choice(char)
y = random.choice(char)
z = random.choice(char)

print a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + x + y + z

How can I make every single letter have it's own symbol and not repeat? Some output I got:

°10?¿012=~===7251@&=2784£-

°¿~°°?¿£%!2~$270!5º%5@0*1º

~6@&~0£!896~!7?$0-£8461-¿-




Aucun commentaire:

Enregistrer un commentaire