- Joined
- Jan 18, 2010
- Messages
- 11,411
Elwing said:TrashyMG said:Personally I like this approach.
#!/usr/bin/python
from random import *
day = randint(1,355)
day = str(day)
print "The Pandora will ship in %s days." % day
yep, but with randint(1,355) returning any int from 1 to 255 as long as it is 61
python rand.py
The Pandora will ship in 317 days.
[root@Trashyserver ~]# python rand.py
The Pandora will ship in 171 days.
[root@Trashyserver ~]# python rand.py
The Pandora will ship in 53 days.
[root@Trashyserver ~]# python rand.py
The Pandora will ship in 301 days.
[root@Trashyserver ~]# python rand.py
The Pandora will ship in 102 days.
[root@Trashyserver ~]# python rand.py
The Pandora will ship in 40 days.
[root@Trashyserver ~]# python rand.py
The Pandora will ship in 165 days.
[root@Trashyserver ~]# python rand.py
The Pandora will ship in 132 days.
seems to have a larger range than 255..
Last edited by a moderator: