06 2020 档案

摘要:字符串的重点内容: # 将int转化为二进制的最少位数 a = 2 a1 = a.bit_length() print(a1) a2 = 3 a3 = a2.bit_length() print(a3) # bool >int的例子(重点理解) while true: pass while 1: # 阅读全文
posted @ 2020-06-18 23:09 安~♥ 阅读(86) 评论(0) 推荐(0)
摘要:回顾逻辑运算: print(6 or 2 > 1) print(0 or 5 < 4) print(5 < 4 or 3) print(3 and 2 > 1) print(0 and 3 > 1) print(2 > 1 and 3) print(3 > 1 and 0) # 要满足两边都是真才是 阅读全文
posted @ 2020-06-08 22:21 安~♥ 阅读(168) 评论(0) 推荐(0)
摘要:循环语句whlie 的使用: count = 1 sum = 0 while count < 101: sum = sum + count count = count + 1 print(sum) 字符串(str):python中用引号引起来的都是str,str是可以相加的,str可以相乘:str* 阅读全文
posted @ 2020-06-05 10:51 安~♥ 阅读(149) 评论(2) 推荐(0)