Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7675439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:57:46+00:00 2026-05-31T16:57:46+00:00

Example: element = [‘Flaming’, ‘Cold’] fire_properties = [‘of Fire’, ‘of Flame’] cold_properties = [‘of

  • 0

Example:

element = ['Flaming', 'Cold']
fire_properties = ['of Fire', 'of Flame']
cold_properties = ['of Ice', 'of Frost']

Fairly simple. Wanted to make a text randomizer and end up with results such as “Flaming sword of Fire” according to this example. Unfortunately, i wasn’t sure of how to make it so that the result from the first list would define from which list the second result would be.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:57:48+00:00Added an answer on May 31, 2026 at 4:57 pm

    Well, I first wrote this one, but Boris’s was more succinct, so I decided not to submit… might be a bit more readable for a beginner, though.

    quality_list =  ['Flaming', 'Frozen', 'etc.']
    quality = random.choice(quality_list)
    
    item_list = ['Sword', 'Dagger', 'Mace', 'etc.']
    item = random.choice(item_list)
    
    
    hot_qualities = ['Flaming', ...]
    cold_qualities = ['Frozen', ...]
    hot_elements = ['Fire', 'Inferno']
    cold_elements = ['Cold', 'Frost']
    
    if quality in hot_qualities:
        element = random.choice(hot_elements)
    elif quality in cold_qualities:
        element = random.choice(cold_elements)
    
    # NB this is Python 2.X's print and string format, adjust accordingly for 3.X
    print "%s %s of %s" % (quality, item, element)
    

    Though in real project I’d generalize it further like Boris did.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this simple xml element example: <parent foo=1 bar=2 foobar=3> <child/> </parent> In the
For example: string element = 'a'; IEnumerable<string> list = new List<string>{ 'b', 'c', 'd'
Example XML using element nodes: <?xml version=1.0 encoding=utf-8?> <users> <user> <name>David Smith</name> <phone>0441 234443</phone>
how i can duplicate one element from array: for example, i have this array:
I've scoured google for an example on scrolling to an element by ID on
When I am writing for example Spring Bean I often have empty element without
Example: var $doesNotYetExistInTheDOM = $('<span/>'); // create new jQuery element // outside of the
Please could someone post an example of how to check if an element exists
I am trying to find an example of placing an element above the Table
I can't access a element with its href. Like this example, i need add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.