21 lines
542 B
Python
21 lines
542 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
Created on Wed Sep 2 21:21:46 2026
|
|
|
|
@author: joseph
|
|
|
|
- I created this file to find out how binary operations would format output
|
|
after I realized that I couldn't k&2 because it was not reliable. I believe I
|
|
now understand it to be that & sets each bit to 0 if either bit is 0, therefore
|
|
when running k&2, it was printing the decimal version of the binary output,
|
|
which would be either 2 or 0.
|
|
"""
|
|
|
|
k = (int(input('Give a value for k... ')))
|
|
l = k & 2
|
|
print(l)
|
|
|
|
|
|
|
|
|