I need help writting a program.
1) Random string generation
2) no repeating letters
Can anyone help me,please? I am so confused. The only problem is I have to use the code that is written there but add on to it.
import random
alphabet = "abcdefghijklmn opqrstuvwxyz"
myNewString = ""
for letters in alphabet:
myNewString = myNewString + alphabet[random.randrang e(26)]
print myNewString
I know that if I run it now it adds a new letter for 26 lines but i need none of those letters to repeat.
1) Random string generation
2) no repeating letters
Can anyone help me,please? I am so confused. The only problem is I have to use the code that is written there but add on to it.
import random
alphabet = "abcdefghijklmn opqrstuvwxyz"
myNewString = ""
for letters in alphabet:
myNewString = myNewString + alphabet[random.randrang e(26)]
print myNewString
I know that if I run it now it adds a new letter for 26 lines but i need none of those letters to repeat.
Comment