list = ['a', 'b', 'c', 'BC', 'BG', 'UC', 12, 15, 17, 20, 25] data=[] for i in list: z=str(i) data.append(z) print(data) data1=random.sample(data,3) print(''.join(data1))
python1-写一段代码实现从列表list=[‘a‘,‘b‘,‘c‘,‘BC‘,‘BG‘,‘UC‘,12,15,17,20,25]中随机获取3个元素,并将获取的元素以字符串形式拼接后输出
于 2024-04-01 14:44:20 首次发布