fork download
  1. def hitungNomorBit(n, bit):
  2. if bit < 0:
  3. return None
  4.  
  5. if bit == 0:
  6. return 1
  7.  
  8. if bit == 1:
  9. return 3
  10.  
  11. return None
  12.  
  13. # Contoh penggunaan fungsi
  14. print(hitungNomorBit(13, 0))
  15. print(hitungNomorBit(13, 1))
  16. print(hitungNomorBit(13, 2))
  17.  
Success #stdin #stdout 0.02s 6968KB
stdin
Standard input is empty
stdout
1
3
None