RE: Art idea generator

You are viewing a single comment's thread from:

Art idea generator

in art •  last year 

import random # Don't forget to import the 'random' module

def generate_category_items(categories, total_items):
items = []
for _ in range(total_items):
selected_category = random.choice(list(categories.keys()))
selected_item = random.choice(categories[selected_category])
items.append(f"{selected_item} - {selected_category} Theme")
return items

AI Algorithm Categories

categories = {
"Art/Culture": ["Painting", "Sculpture", "Music", "Dance", "Literature"],
"Marijuana/Plants": ["Cannabis", "Hemp", "Bamboo", "Sunflower", "Fern"],
"Steampunk/Cyberpunk": ["Goggles", "Gear", "Neon", "Cybernetic", "Dystopia"]
}

Generate 1000 items

random_items = generate_category_items(categories, 1000)

Pull 10 items at a time until all items are used

while random_items:
batch = random_items[:10]
random_items = random_items[10:]
print("Batch of 10 Items:")
for i, item in enumerate(batch, start=1):
print(f"{i}. {item}")

print("All items used.")

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!