Python: Create all possible strings by using a, e, i, o, u

Python Basic - 1: Exercise-2 with Solution

Write a Python program to create all possible strings by using 'a', 'e', 'i', 'o', 'u'. Use the characters exactly once.
Sample Solution:
import random
import string
char_list = ['a','e','i','o','u']
random.shuffle(char_list)
print(''.join(char_list))

#隨機整數：
#>>> import random
a=random.randint(0,99)
print("隨機整數 =",a)

#隨機選取0到100間的偶數：
#>>> import random
a=random.randrange(0, 101, 2)
print("隨機選取0到100間的偶數 =",a)

#隨機浮點數：
#>>> import random
a1=random.random()
a2=random.uniform(1, 10)
print("隨機浮點數 =",a1)
print("隨機浮點數 =",a2)

#隨機字元：
#>>> import random
a=random.choice('abcdefg&#%^*f')
print("隨機字元 =",a)

#多個字元中選取特定數量的字元：
#>>> import random
a=random.sample('abcdefghij',3)
print("多個字元中選取特定數量的字元 =",a)

#多個字元中選取特定數量的字元組成新字串：
#>>> import random
#>>> import string
a=''.join(random.sample(['a','b','c','d','e','f','g','h','i','j'], 3)).replace(',','')
print("多個字元中選取特定數量的字元組成新字串 =",a)

#隨機選取字串：
#>>> import random
print("隨機選取字串 =",random.choice ( ['apple', 'pear', 'peach', 'orange', 'lemon'] ))

#洗牌：
#>>> import random
list1= [1, 2, 3, 4, 5, 6]
random.shuffle(list1)
print("洗牌 =",list1)

========= RESTART: F:/Python_APSC/py-ex2-basic-2.py =============
ouaei

>>>