randnum=random.randint(0,2) result=list1[randnum] print(result) 注意这个第二行和第三行,这里randnum是作为一个数字来的,要注意一下。