Random-Numbers

Sat 17 May 2025

title: "Random Numbers" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import random as rd
def get_random():
    return rd.randint(0, 100)
get_random()
61
def get_random_year_duration():
    return round(rd.uniform(1,2), 1)
get_random_year_duration()
1.6
def get_random_price():
    return round(rd.uniform(1, 100), 2)
get_random_price()
43.21
def get_random_double():
    return (rd.uniform(1, 100))
get_random_double()
45.42541472652959


Score: 10

Category: basics