摘要:
>>> import random >>> random.choice(['apple', 'pear', 'banana']) #从给定列表中选择一个 'apple' >>> random.sample(range(100), 10) # sampling without replacement 阅读全文
>>> import random >>> random.choice(['apple', 'pear', 'banana']) #从给定列表中选择一个 'apple' >>> random.sample(range(100), 10) # sampling without replacement 阅读全文
posted @ 2022-01-21 11:00
paoPaoLong_liu
阅读(37)
评论(0)
推荐(0)
摘要:
>>> import re >>> re.findall(r'\bf[a-z]*', 'which foot or hand fell fastest') 在python命令行窗口输入以上命令,会出现一个列表['foot','fell','fastest'],这个结果是根据第一个参数在第二个参数字符 阅读全文
>>> import re >>> re.findall(r'\bf[a-z]*', 'which foot or hand fell fastest') 在python命令行窗口输入以上命令,会出现一个列表['foot','fell','fastest'],这个结果是根据第一个参数在第二个参数字符 阅读全文
posted @ 2022-01-21 10:44
paoPaoLong_liu
阅读(55)
评论(0)
推荐(0)

浙公网安备 33010602011771号