python 基础知识点 积累

python中的按位取反:https://www.jianshu.com/p/956f1f3c65ee

python将整数转换成二进制形式的方法:https://blog.csdn.net/ACBC12345/article/details/124441879
zfill():https://blog.csdn.net/m0_57394815/article/details/122561351

bin(4).replace("0b","").zfill(8)

list.find() 与 list.rfind() :https://wenku.baidu.com/view/848cf439f28583d049649b6648d7c1c708a10bb2.html

Python中的队列:https://blog.csdn.net/qq_33254766/article/details/109154689
Queue队列中的join()和task_done()的关系:https://blog.csdn.net/weixin_46739549/article/details/123199043

#把字符转为ascii
ord('a')
#把ascii转为字符
chr(ord('a')+1) #b

bisect.bisect(string, i), bisect.bisect_left(), bisect.bisect_right():https://wenku.baidu.com/view/052659f0baf3f90f76c66137ee06eff9aef8491d.html

python 中 strrepr 用法:https://blog.csdn.net/qq_39355550/article/details/82110661
python 中 str,__len__用法:https://www.cnblogs.com/learningcaiji/p/13796553.html
python内置函数 str(),repr():https://www.cnblogs.com/sddai/p/14884688.html

class Parent(object):
 x = 1
class Child1(Parent):
 def __str__(self):
   return str(self.x * 2)
class Child2(Parent):
 def __str__(self):
   return str(len(self))
 def __len__(self):
   return self.x * 3
c1 = Child1()
c2 = Child2()
print(Parent.x, Child1.x, Child2.x, c1, c2)
Child1.x = 2
print(Parent.x, Child1.x, Child2.x, c1, c2)
Parent.x = 3
print(Parent.x, Child1.x, Child2.x, c1, c2)
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Sarah ฅʕ•̫͡•ʔฅ

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值