Operators...
# Airthmetic Operators
# +, -, *, /
# a = 45
# b = 5
# print((a+b),(a-b),(a*b),(a/b))
#Assignment Operators
# =, +=, -=, *+, /=
# a = 15
# a += 5
# print(a)
# b = 10
# b -= 5
# print(b)
# c = 25
# c *= 5
# print(c)
# d = 14
# d /= 2
# print(d)
#Comparison Operators
# ==, >, <, >=, <=, !=
# a = 5
# b = 7
# print(a==b)
# print(a>b)
# print(a<b)
# print(a>=b)
# print(a<=b)
# print(a!=b)
#Logical operators
# and, or, not
a = True
b = False
print("The value of bool1 and bool2 is", (a and b))
print("The value of bool1 or bool2 is", (a or b))
print("The value of not bool2 is", (not b))
No comments:
Post a Comment