/* Generating random number -------------------------------- */ from random import randint print(randint(0,5)) >>> # anyone from 0 to 5
For generating only 0 or 1 print(randint(0,1)) >>> 0 or 1 Best, Bhanu Pratap www.bhanubais.com -----Original Message----- From: Tutor [mailto:[email protected]] On Behalf Of Joe Jacques Sent: 03 October 2013 10:02 PM To: [email protected] Subject: [Tutor] how to generate random numbers in Python Problems in the link http://home.manhattan.edu/~ankur.agrawal/cmpt101/assgn5.txt Sent from my iPhone _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
