From db1c839e5ee36e5a356955f7b9d0912d483f9e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9E=A5=EB=B2=94=EC=A7=84?= <wony5248@ajou.ac.kr> Date: Tue, 20 Nov 2018 12:45:05 +0900 Subject: [PATCH] Upload New File --- bit.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 bit.py diff --git a/bit.py b/bit.py new file mode 100644 index 0000000..91aad60 --- /dev/null +++ b/bit.py @@ -0,0 +1,38 @@ +Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32 +Type "copyright", "credits" or "license()" for more information. +>>> a&1 +Traceback (most recent call last): + File "<pyshell#0>", line 1, in <module> + a&1 +NameError: name 'a' is not defined +>>> a=0b1100 +>>> a&1 +0 +>>> a&15 +12 +>>> 10&15 +10 +>>> 12&15 +12 +>>> a|15 +15 +>>> a|1 +13 +>>> a^1 +13 +>>> a^16 +28 +>>> a^15 +3 +>>> 0b1100 ^ 0b1111 +3 +>>> 0b1100 & 0b 1111 +SyntaxError: invalid token +>>> 0b1100&0b1111 +12 +>>> a=255 +>>> ~a +-256 +>>> # +>>> #보수취하면 음수취하고 -1 해줌 +>>> -- GitLab