Найти - Пользователи
Полная версия: Обьединение строк
Начало » Python для новичков » Обьединение строк
1
Areostar
пишу так:

 import random
base = ["user", "login"]
addition = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10"]
login =  str(random.choices(base)) + str(random.choices(addition))
print(login)

результат получаю - в скобках ‘login’] ‘08’ ]

почему я не получил просто login08 ??
JOHN_16
потому что вы перепутали choice и choices. А всего лишь надо было документацию почитать
Romissevd
 random.choice
Areostar
Опписался )) Спасибо что поправили!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB