Computer Science, asked by jaswanthrocks842, 1 year ago

Write a Python program to create all possible strings by using 'a', 'e', 'i', 'o', 'u'.
Use the characters exactly once

Answers

Answered by neelamgeethikasarayu
5

Answer:

import random

char_list = ['a','e','i','o','u']

random.shuffle(char_list)

print(''.join(char_list))

output:iauoe

Explanation:

Answered by Anonymous
15

 \mathtt{ from \quad itertools \quad import \quad permutations} \\ \\ \mathtt{chars \: = \: list('a','e','i','o','u')} \\ \\ \mathtt{allStrings \: = \:  permutations(chars)} \\ \\ \mathtt{for \quad string \quad in \quad allStrings:} \\ \qquad \mathtt{print('\:'.join(string)) }

Similar questions