-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcodingClass1.py
More file actions
56 lines (41 loc) · 1.08 KB
/
codingClass1.py
File metadata and controls
56 lines (41 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# VARIABLES AND DATA TYPES
# x = 10
# y = x
# print (x, y)
# print (type(x), type(y))
# print (id(x),id(y))
#operators
#1. remainder operator
# a = float(input("Enter first number: "))
# b = float(input("Enter second number: "))
# print(a % b)
#2. relational operations
# a = float(input("Enter first number: "))
# b = float(input("Enter second number: "))
# print(a > b)
#3. logical operations
# a = float(input("Enter a: "))
# b = float(input("Enter b: "))
# c = float(input("Enter c: "))
# print("a and b: ",(a and b))
# print("a or b: ",(a or b))
# print("a and b or c: ",(a and b or c))
# 4. Bitwise operations
# a = int(input("Enter a: "))
# b = int(input("Enter b: "))
# print("a and b: ",(a & b))
# print("a or b: ",(a | ~b))
# 5. Shifting operations
# a = int(input("Enter a: "))
# b = int(input("Enter b: "))
# print("b>>1: ",(b>>1))
# print("b<<1: ",(b<<1))
# print("b<<2: ",(b<<2))
# 6. Identity operations
a = int(input("Enter a: "))
b = int(input("Enter b: "))
c = a
print("a is b: ",(a is b))
print("a is c: ",(a is c))
print("a == b: ",(a == b))
print("a == c: ",(a == c))