Using the Random Module.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • WDC

    Using the Random Module.

    I am currently learning, and loving, Python and have a question about
    random().

    Right now, what I have to do to get a whole number and not a decimal
    using random.random() is this:
    >>>random.rando m()
    0.8476572850185 6734
    >>>_ * 10**17
    847657285018567 34.0

    Is there a better way to do that besides doing this:
    >>>random.randi nt(000000000000 00000, 999999999999999 99)
    096573986712387 69

    Thanks for your time.

    David
Working...