随笔分类 -  python

摘要:import 首先要import random 随机生成数 生成随机浮点数 random.random(): 返回随机生成的一个浮点数,范围在[0,1)之间 np.random.rand(d0, d1, …, dn): 返回一个或一组浮点数,范围在[0, 1)之间 random.uniform(a, 阅读全文
posted @ 2023-02-25 17:33 山上有只羊 阅读(120) 评论(0) 推荐(0) 编辑
摘要:字符串 字符串是否包含子字符串 两种方法:[find()] [in]/[not in] // 方法一 if string1.find(string2): print("found string2 in string1") // 方法二 if string2 in string1: print("fo 阅读全文
posted @ 2023-02-22 09:36 山上有只羊 阅读(12) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示