Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 31st, 2005, 8:47 AM   #1
dezza
Newbie
 
dezza's Avatar
 
Join Date: Mar 2005
Location: Denmark
Posts: 16
Rep Power: 0 dezza is on a distinguished road
Send a message via ICQ to dezza Send a message via MSN to dezza
Hard understanding part of tutorial

http://ibiblio.org/obp/thinkCS/pytho...h/chap09.htm#4

I am doing this tutorial, but when it comes to the exercise in this part 9.4 I'm stuck, I do not understand the high and low thing, what does he mean with that?

Quote:
To generate a random number between 0.0 and an upper bound like high, multiply x by high.

As an exercise, generate a random number between low and high.
__________________
Come in and have a talk!
#programmingforums @ Freenode

Specialities: Linux, XHTML/HTML and CSS.
Learning: Python

Folding@Home Stats

System Requirements: Windows 9x/ME/2000/XP or better
Okay, that makes it run on Linux right?
dezza is offline   Reply With Quote
Old May 31st, 2005, 9:42 AM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
High and Low are the highest and lowest numbers that the random number function can generate. random.random()'s default high and low are 1 and 0 respectively. Therefore, to generate a different high, you multiply by the high, and to generate a different low, you add the low.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:26 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC