python - How can I randomly select an item from a list?
#short
#python
#list
#random
How do I retrieve an item at random from the following list?
foo = ['a', 'b', 'c', 'd', 'e']
random.choice(): https://docs.python.org/library/random.html#random.choice
cryptographically secure: https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator
secrets.choice(): https://docs.python.org/library/secrets.html#secrets.choice
random.SystemRandom: https://docs.python.org/library/random.html#random.SystemRandom
Видео python - How can I randomly select an item from a list? канала Code Samples
#python
#list
#random
How do I retrieve an item at random from the following list?
foo = ['a', 'b', 'c', 'd', 'e']
random.choice(): https://docs.python.org/library/random.html#random.choice
cryptographically secure: https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator
secrets.choice(): https://docs.python.org/library/secrets.html#secrets.choice
random.SystemRandom: https://docs.python.org/library/random.html#random.SystemRandom
Видео python - How can I randomly select an item from a list? канала Code Samples
Комментарии отсутствуют
Информация о видео
31 марта 2023 г. 12:03:12
00:00:22
Другие видео канала