Skip to content

Commit 69d6633

Browse files
committed
Refactored logical operations and added new sections for bitwise, shifting, and identity operations
1 parent d1a2daf commit 69d6633

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

Classwork/codingClass1.py

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,34 @@
2323

2424

2525
#3. logical operations
26-
a = float(input("Enter a: "))
27-
b = float(input("Enter b: "))
28-
c = float(input("Enter c: "))
29-
print("a and b: ",(a and b))
30-
print("a or b: ",(a or b))
31-
print("a and b or c: ",(a and b or c))
26+
# a = float(input("Enter a: "))
27+
# b = float(input("Enter b: "))
28+
# c = float(input("Enter c: "))
29+
# print("a and b: ",(a and b))
30+
# print("a or b: ",(a or b))
31+
# print("a and b or c: ",(a and b or c))
32+
33+
34+
# 4. Bitwise operations
35+
# a = int(input("Enter a: "))
36+
# b = int(input("Enter b: "))
37+
# print("a and b: ",(a & b))
38+
# print("a or b: ",(a | ~b))
39+
40+
41+
# 5. Shifting operations
42+
# a = int(input("Enter a: "))
43+
# b = int(input("Enter b: "))
44+
# print("b>>1: ",(b>>1))
45+
# print("b<<1: ",(b<<1))
46+
# print("b<<2: ",(b<<2))
47+
48+
49+
# 6. Identity operations
50+
a = int(input("Enter a: "))
51+
b = int(input("Enter b: "))
52+
c = a
53+
print("a is b: ",(a is b))
54+
print("a is c: ",(a is c))
55+
print("a == b: ",(a == b))
56+
print("a == c: ",(a == c))

0 commit comments

Comments
 (0)