more with lists this sounds like something we could use shuffle forbut shuffle only works with lists what we need to do is convert our string into listuse shuffle on itand then convert the list back into string to turn string into listwe can use list( (see section to turn the list back into stringwe will use join from random import shuffle word input'enter word'letter_list list(wordshuffle(letter_listanagram 'join(letter_listprint(anagram list comprehensions list comprehensions are powerful way to create lists here is simple examplel [ for in range( )this creates the list [ , , , , notice that the syntax of list comprehension is somewhat reminiscent of set notation in mathematics here are couple more examples of list comprehensions for these examplesassume the followingstring 'hello [ , , , , 'one ''two ''three ''four ''five ''six 'list comprehension resulting list [ for in range( )[ , , , , , , , , , [ ** for in range( , )[ * for in [ , , , , , , [ * for in string[ [ for in ['hh','ee','ll','ll','oo'[ for in if < [ , , [ [ for in if len( )== [' ',' ',' '[ , , , , [' ',' ',' ',' ',' ',' 'as we see in the last two exampleswe can add an if to list comprehension compare the last example with the long way of building the listl [for in mif len( )== append(mmultiple fors you can use more than one for in list comprehension