How to change if the i th bit is 1,replace with (i+1) bit in python?

后端 未结 0 1354
谎友^
谎友^ 2020-12-31 04:29

for example read a number=23 and a bit position=2,after checking the i th position replace it with (i+1)th bit.

n = int(input("Enter a number: "))
p         


        
相关标签:
回答
  • 消灭零回复
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题