隨機(jī)函數(shù)Shuffle在python中的含義
提問人:楊紫紅發(fā)布時(shí)間:2020-11-19
Shuffle 把列表洗牌重新排序
>>> import random
>>> desserts = ['ice cream', 'pancakes', 'brownies', 'cookies',
'candy']
>>> random.shuffle(desserts)
>>> print(desserts)
['pancakes', 'ice cream', 'candy', 'brownies', 'cookies']
繼續(xù)查找其他問題的答案?
相關(guān)視頻回答
點(diǎn)擊加載更多評(píng)論>>