random from a float to int python code example
Example 1: random float python
>>> random.uniform(1.5, 1.9)
1.8733202628557872
Example 2: convert float to int python
# convert float to int
x=3.1415
y=int(x)
print(y) #outputs 3
Example 3: float to int in python
# convert float to int
int(2.0) #output :2
Example 4: random float python
import random
print(random.random(1, 10)) # any int or float