-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay_3.py
More file actions
27 lines (25 loc) · 828 Bytes
/
Copy pathDay_3.py
File metadata and controls
27 lines (25 loc) · 828 Bytes
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
#This is a program for assignment operator
a=float(input("Enter the value of a ="))
b=float(input("Enter the value of b ="))
addition=a+b
subtraction=a-b
multiplication=a*b
Division=a/b
modulus=a%b
floor_division=a//b
power=a**b
print("Addition",addition,"\nSubtraction",subtraction,"\nMultiplication:",multiplication,"\nDivision:",Division,"\nModulus",modulus,"\nFloor division:",floor_division,"\nPower",power)
OR
a=7
b=6
print("Addition is :",a+b,"\nDifference is:",a-b,")
#This is a program for rcomparison operators
a=float(input("Enter the value of a :"))
b=float(input("Enter the value of b :"))
print((a==b),(a!=b),(a>b),(a<b),(a>=b),(a<=b))
#This is a program for logical operators
a=float(input("Enter the value of a ="))
b=float(input("Enter the value of b ="))
print(a>b and b<a)
print(a>b or b<a)
print(not(a>b))