Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 04-09-2007, 04:20 PM Randomize in Python
Experienced Talker

Posts: 30
Name: Peter
Trades: 0
I want to pull a random word out of a list, or tuple in Python and insert it into a sentence.

So the program after it has finished running would look something like this.

"John (random inserted word from list or tuple) Jane."

How would I achieve that?
D.O.I.P is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-18-2007, 04:30 AM Re: Randomize in Python
Novice Talker

Posts: 5
Name: Rick Ralston
Trades: 0
Randomizing function in Python is below

Code:
random.shuffle(list)
any codes, libraries, etc, available in http://www.pythonware.com/.

If you have more questions, let me know. Am happy to answer your questions.
__________________

Please login or register to view this content. Registration is FREE
-- Metrics You Can Count On
RealMetrics is offline
Reply With Quote
View Public Profile Visit RealMetrics's homepage!
 
Reply     « Reply to Randomize in Python
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09727 seconds with 12 queries