import random

# Define the character groups
groups = [
    ['!', '#', '$'],
    ['h', 'i', 'j'],
    ['K', 'L', 'M'],
    ['4', '5', '6'],
    ['{', '|', '}']
]

# Choose two random characters from each group
chosen_chars = [random.sample(group, 2) for group in groups]
print(chosen_chars)

# Choose two random groups and one random character from each
group1, group2 = random.sample(groups, 2)
print(f"G1:{group1} - G2:{group2}")
char1, char2 = random.sample(group1, 1)[0], random.sample(group2, 1)[0]
print(f"C1:{char1} - C2:{char2}")

while char1 == char2:
    # Make sure the random characters are not the same
    char2 = random.sample(group2, 1)[0]
    print(char2)
chosen_chars.append([char1, char2])

# Flatten the list of chosen characters
chosen_chars = [char for group in chosen_chars for char in group]

# Convert the list of characters to a string
random_seq = ''.join(chosen_chars)

print(f"\n\tPASSWORD: {random_seq}")

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: