Learn how to use the python random module in efficient way #shorts
Source code:
import random
1. random()- Random float number between 0.1 to 1.0
print(random.random())
2. randint()- Random integer between specified integers
print(random.randint(1,20))
3. randrange()- Random integer between specified range
print(random.randrange(1,20,2))
4. choice()- Random value from list
print(random.choice([1,2,3,4,5,6,7,8]))
5. shuffle- Shuffle the order of the items
a=[1,2,3,4,5,6,7,8,9]
random.shuffle(a)
print(a)
6. sample- Random Sample integer
print(random.sample(a,k=2))
If you want to learn more about Python and DevOps, you can get this course-
https://www.udemy.com/course/learn-co...
#python #pythontutorial #pythontipsandtricks #pythontricks #pythonprogramming #pythonshorts #pythonforbeginners #shorts #pythonrandommodule
Nesta página do site você pode assistir ao vídeo on-line How to use Random Module in Python efficiently [Source code available] duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Code with Pranjal Srivastava 29 Julho 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 180 vezes e gostou 6 espectadores. Boa visualização!