0
I want to use some function in python
That function must return me any random string from a given array or list ..... How and which function could be used to solve this problem !!!!
6 ответов
+ 3
use randint from random module
+ 3
# you can use random module
import random
chars = 'abcdefghijklmnopqrstuvwxyz'
use: random.choice(chars).
If you need to get more than one character, you have to run this expression in a loop or in a comprehension.
or
use: random.choices(chars, k = n), where n is the number of desired characters. This does not need to run in a loop.
+ 1
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 didn't notice that ,I should have checked first ,thks
0
Thanks 😃😃😃😃