hi i need to do import random how do it? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

hi i need to do import random how do it?

16th Aug 2020, 11:51 AM
אלעז×Ø ×
אלעז×Ø × - avatar
3 Respostas
+ 1
import random imports the random module, which contains a variety of things to do with random number generation. Among these is the random() function, which generates random numbers between 0 and 1. ======================= from random import random ======================= Doing the import this way this requires you to use the syntax random.random(). The random function can also be imported from the module separately: from random import random This allows you to then just call random() directly.
16th Aug 2020, 11:57 AM
Abdulaziz Abdurasul
Abdulaziz Abdurasul - avatar
0
Thank you i will try
16th Aug 2020, 12:00 PM
אלעז×Ø ×
אלעז×Ø × - avatar