[Solved] Generate similar domain names with Python [closed]


Good question… This is really hard to answer but I attempted a solution(what engineers try to do) that might work based on analyzing the pattern example you gave:

import string
import random

def generate_similar(string):
    # Generates similar name by substituting vowels
    similar_word = []
    for char in string:
        if char.lower() in 'aeiou':
           similar_word.append(random.choice(string.letters).lowercase())
        else:
            similar_word.append(char)
    return ''.join(similar_word)

I got the help from these other questions: Generate a random letter in Python and String replace vowels in Python?

When approaching a problem try to break it up into steps and then google search how to solve those steps. A lot of questions on SO are just people asking how to do you pull the steps together into something I want to do. If you apply some engineering process you can almost always come up with at least the steps on how to do something.

Hope that helps. Good luck with your project!

1

solved Generate similar domain names with Python [closed]