Blend two names into portmanteau combos + random letter shuffle.
# Name Mixer - NumWorks # Created by Alvar Laigna - https://alvarlaigna.com from random import choice,randint def shuf(a): for i in range(len(a)-1,0,-1): j=randint(0,i) a[i],a[j]=a[j],a[i] def mix(): print("\n"*20+"NAME MIXER\n") a = input("Name 1: ").strip().title() b = input("Name 2: ").strip().title() if not a or not b: return m1 = a[:len(a)//2+1]+b[len(b)//2:] m2 = b[:len(b)//2+1]+a[len(a)//2:] c = list(a.lower()+b.lower()) shuf(c) m3 = "".join(c).capitalize() print("Mix 1:",m1) print("Mix 2:",m2) print("Random:",m3) print("Pick:",choice([m1,m2,m3])) if input("Again? y/n: ").lower()=="y": mix() mix()