摘要: strip( )函数:去掉字符串头尾字符或序列。默认为去除空格和换行符 st = "1100110011" new_st = st.strip("1") print(new_st) st = "105555501" new_st = st.strip("10") print(new_st) st = 阅读全文
posted @ 2020-02-04 22:17 Mqqq 阅读(222) 评论(0) 推荐(0)
摘要: seed( a)函数:初始化随机数种子,只要种子相同,每次生成的随机数也相同。 randint( a,b)函数:随机生成[a,b]之间的整数。 import random random.seed('a') num1 = random.randint(0,3) num2 = random.randin 阅读全文
posted @ 2020-02-04 20:22 Mqqq 阅读(1846) 评论(0) 推荐(0)