shuffle string in python January 30, 2023 by Tarik >>> import random >>> s="abcdef123" >>> ''.join(random.sample(s,len(s))) '1f2bde3ac'