+ 1
Random letters(python)
How do i generate 5 random different letters? I created this code atm https://code.sololearn.com/cau73YH6133s/?ref=app
3 odpowiedzi
+ 2
TurtleShell that can duplicate letters.
import random
import string
letters = []
letters = [l for _ in range(5) for l in random.choice(string.ascii_letters) if l not in letters]
[print(l, end=' ') for l in letters]
+ 2
Oh sorry didn’t see the word different
0
from random import choice
from string import ascii_letters
i=5
while i!=0:
print(choice(ascii_letters))
i-=1